Skip to content

[MIG] Forward-port changes from 14.0 - #359

Merged
ecino merged 14 commits into
18.0from
18.0-ff
Aug 5, 2026
Merged

[MIG] Forward-port changes from 14.0#359
ecino merged 14 commits into
18.0from
18.0-ff

Conversation

@ecino

@ecino ecino commented Aug 5, 2026

Copy link
Copy Markdown
Member

No description provided.

Danielgergely and others added 14 commits July 16, 2026 15:21
- FIX: show the beginning-of-sponsorship photo (was filtered out by import
  date); date photos by their real date, kept below the start marker
- FIX:  infinite-scroll offset so entries between the first page and the
  next batch are no longer skipped (dropped whole years of letters)
- REFACTOR: derive the total via COUNT(*) OVER (), dropping the duplicate count query

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
defensive programming
[T3228] FIX: correct MyCompassion timeline photos and missing entries
- FIX: making sure the action url is re-computed for every participant every time their profile loads (with the t- tag)
…ction

[T3325] FIX: event donation form posting to wrong participant
…-less) language

- quickfix for v14, should already be handled in v18
- FEAT: added language switcher to muskathlon event
…ault-lang

[T3344] FIX: language switcher couldn't return to the default (prefixless) language
- Drive the cron from device tokens instead of scanning 10'000+ children;
…rformance

[T3350] FIX: birthday push cron stalled all scheduled actions
The portal computed can_i_write_letter/is_writer straight off
recurring.contract.can_write_letter, which is False whenever the
project has hold_s2b_letters set, hiding the "Write a letter" option
entirely while the FCP is suspended.

Pass allow_during_suspension in context when computing these, mirroring
what mobile_app_connector already does for the app hub. The existing
sbc_compassion correspondence.create_commkit()/hold_letters_action()/
reactivate_letters() machinery already holds the letter as an
"Exception" and auto-resubmits it once the FCP reactivates - it was
just never reached because the portal blocked letter creation before
it could run.
- FIX: Guard _onSubmitLetter to prevent a double click + error
[T3352] FIX: guard letter submit against double-click race
@ecino
ecino merged commit 0990372 into 18.0 Aug 5, 2026
2 checks passed
@ecino
ecino deleted the 18.0-ff branch August 5, 2026 06:44
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex posted the initial finding-comment proof for the P1 finding and attached artifacts showing the payer-only sponsorship lookup, the focused reproduction harness, the timeline reproduction execution, the model authorization source for a correspondent portal user, and the Python syntax validation.
  • T-Rex followed with a second finding-comment proof for the P1 finding, including the Review-authored legacy timeline helper reproduction source and an artifact confirming the complete timeline helper call passes argument binding.
  • T-Rex produced a third finding-comment proof for the P1 finding, with no artifacts attached.
  • T-Rex issued a general-contract-validation-proof detailing reproduction, the source capture, and uploaded Greptile evidence for contract validation.
  • T-Rex delivered a final general-contract-validation-proof describing the test failures and the recommended timeline parameter fix for TestChildTimeline._timeline.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (2)

  1. General comment

    P1 Correspondent-only portal users lose child timeline pictures

    • Bug
      • _get_sponsorship_start searches contracts only through partner_id, even though the portal child authorization model accepts a user matched by correspondent_id. For a contract whose payer and correspondent differ, the correspondent can open the child but the start lookup returns no contract. The subsequent timeline picture predicate receives NULL for both sponsorship_start and beginning_picture_id, so no child pictures can qualify.
    • Cause
      • The contract domain at my_compassion/controllers/my2_children.py:164 contains ('partner_id', 'in', partner_ids) without a corresponding correspondent_id branch, unlike my_compassion/models/compassion_child.py:65-71, which authorizes either relationship.
    • Fix
      • Search the start contract using an OR domain matching either partner_id or correspondent_id against partner_ids; make the start/end timeline and picture-related contract filters consistent with that authorization rule. Add an Odoo regression test with distinct payer and correspondent partners and a child picture.

    T-Rex Ran code and verified through T-Rex

  2. General comment

    P1 Focused timeline tests call _get_timeline_data with an obsolete arity

    • Bug
      • TestChildTimeline._timeline supplies only child_id, partner_ids, offset, and limit, while the PR makes sponsorship_start and beginning_picture_id required. Each of the four tests that invokes _timeline() fails before testing its intended behavior.
    • Cause
      • The controller method signature was extended in my_compassion/controllers/my2_children.py:195-196, but the direct test helper caller at my_compassion/tests/test_child_timeline.py:81-83 was not updated.
    • Fix
      • Pass values for sponsorship_start and beginning_picture_id from the fixture/helper, or change the test helper to call _get_timeline_records, which already computes and supplies them.

    T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "[MIG] Forward-port changes from 14.0" | Re-trigger Greptile

.search(
[
("child_id", "=", child_id),
("partner_id", "in", partner_ids),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Correspondent sponsorship start is missed

The portal authorization path permits a user linked as recurring.contract.correspondent_id, but this sponsorship lookup only searches partner_id. When the payer and correspondent differ, an authorized correspondent receives no sponsorship start or beginning picture ID; the subsequent picture query is given null values and excludes the child's pictures from the timeline. Search both partner_id and correspondent_id so the timeline lookup matches the authorization model.

Artifacts

Controller source showing payer-only sponsorship lookup

  • Captured the affected controller lookup and its timeline call chain, showing that only `partner_id` is used; this establishes the precondition for the failure.

Focused correspondent-only timeline reproduction harness

  • The uploaded executable harness imports the actual controller and creates a distinct payer and correspondent fixture; it exercises the claimed failure path.

Executed correspondent-only timeline reproduction

  • Running the focused harness shows the correspondent authorized as partner 200, the payer-only lookup domain, a missing sponsorship start, NULL picture parameters, and an empty timeline; the candidate is reproduced.

Model authorization source for a correspondent portal user

  • Captured the model query that recognizes either payer or correspondent as the user's sponsorship; it confirms the reproduced fixture is an allowed portal-access case.

Controller Python syntax validation

  • Compiled the affected controller successfully after the focused execution setup; the inspected module is syntactically valid.

View artifacts

T-Rex Ran code and verified through T-Rex

Comment on lines +195 to +196
sponsorship_start,
beginning_picture_id,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Timeline test helper uses the obsolete method signature

_get_timeline_data now requires sponsorship_start and beginning_picture_id, but TestChildTimeline._timeline still invokes it with only the prior four arguments. The four timeline tests fail immediately with a missing-positional-arguments TypeError, before exercising their intended timeline behavior. Update the helper to pass the new values or call _get_timeline_records, which supplies them.

Artifacts

Review-authored legacy timeline helper reproduction source

  • A Python script parses the checked-out controller and focused test helper, then executes the same four-argument call; it is the source used to reproduce the failure.

Legacy timeline helper call fails with missing arguments

  • Executed `python3 trex-artifacts/pr359-timeline-helper-01-before.py` in `/home/user/repo`; it reports the four affected tests and the observed missing-arguments TypeError, confirming the bug.

Review-authored complete-arity control source

  • A Python control script invokes the same checked-out method with all seven positional arguments to distinguish argument binding from the unavailable Odoo runtime.

Complete timeline helper call passes argument binding

  • Executed `python3 trex-artifacts/pr359-timeline-helper-02-after.py` in `/home/user/repo`; it passes argument binding and stops only at the isolated script's absent Odoo request global, confirming the prior error is arity-specific.

View artifacts

T-Rex Ran code and verified through T-Rex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants