Interviews: notes typed or extended on the phone are never pulled, then erased by the next push #22

Closed
opened 2026-10-01 10:47:52 +00:00 by tiagoagueda · 1 comment
Owner

Found on 2026-09-29 in a read-only review of postulo-dav at 97abc9779, reading apply_event and running a pull and a push against the test suite's fake server.

apply_event takes the event's DESCRIPTION as the interview's notes only when it does not start with the notes already here. The rule exists to ignore the "With: …" line Postulo itself appends, but it also discards real edits: when the interview has no notes, every description starts with the empty string, and when the phone adds to existing notes, the result still starts with the old ones. The run counts the event as pulled and stores its ETag, so nothing remembers the text was not taken, and the next push for any other reason overwrites the event with Postulo's description.

  • Where: src/postulo_dav/sync.py:202-208 (apply_event: and not event.description.startswith(interview.notes)); src/postulo_dav/sync.py:629-635 (_sync_interviews: after apply_event the link takes the remote ETag and a local_hash computed from the unchanged interview).
  • What happens:
    1. An interview with no notes is synced. On the phone, its description is set to "Bring the portfolio".
    2. The next run reports "1 pulled"; the interview's notes stay empty.
    3. The room is changed in Postulo. The next run pushes the event built from event_lines(), and the phone's description no longer contains "Bring the portfolio".
      Reproduced against the FakeDav from tests/test_dav.py (the pushed event's VALARM removed so that its own DESCRIPTION does not interfere). The same happens to "Bring CV" extended to "Bring CV and the portfolio".
  • Why it matters: what the person writes about an interview on their phone is reported as synced and then destroyed on the server, with no note anywhere.
  • Fix: remove exactly what Postulo appends (the "With: …" line and, once written, the application's link) from the end of the incoming description, then apply any difference, empty notes included. More robust: keep a digest of the description Postulo last pushed on the link and treat any other incoming value as an edit made on the phone.

Related to #11, which covers a VALARM's DESCRIPTION replacing the notes and asks that the "With:" line be told apart from the notes, but not this rule, which drops the phone's edits even once the parser is fixed.

Done when

  • Tests in tests/test_dav.py that set a description on the phone for an interview with empty notes, and extend one with existing notes, and assert after one run that the notes equal the phone's text, and after a further local change and push that the server's event still carries it.
Found on 2026-09-29 in a read-only review of postulo-dav at 97abc9779, reading `apply_event` and running a pull and a push against the test suite's fake server. `apply_event` takes the event's DESCRIPTION as the interview's notes only when it does not start with the notes already here. The rule exists to ignore the "With: …" line Postulo itself appends, but it also discards real edits: when the interview has no notes, every description starts with the empty string, and when the phone adds to existing notes, the result still starts with the old ones. The run counts the event as pulled and stores its ETag, so nothing remembers the text was not taken, and the next push for any other reason overwrites the event with Postulo's description. - **Where:** `src/postulo_dav/sync.py:202-208` (`apply_event`: `and not event.description.startswith(interview.notes)`); `src/postulo_dav/sync.py:629-635` (`_sync_interviews`: after `apply_event` the link takes the remote ETag and a `local_hash` computed from the unchanged interview). - **What happens:** 1. An interview with no notes is synced. On the phone, its description is set to "Bring the portfolio". 2. The next run reports "1 pulled"; the interview's notes stay empty. 3. The room is changed in Postulo. The next run pushes the event built from `event_lines()`, and the phone's description no longer contains "Bring the portfolio". Reproduced against the `FakeDav` from `tests/test_dav.py` (the pushed event's `VALARM` removed so that its own DESCRIPTION does not interfere). The same happens to "Bring CV" extended to "Bring CV and the portfolio". - **Why it matters:** what the person writes about an interview on their phone is reported as synced and then destroyed on the server, with no note anywhere. - **Fix:** remove exactly what Postulo appends (the "With: …" line and, once written, the application's link) from the end of the incoming description, then apply any difference, empty notes included. More robust: keep a digest of the description Postulo last pushed on the link and treat any other incoming value as an edit made on the phone. Related to #11, which covers a `VALARM`'s DESCRIPTION replacing the notes and asks that the "With:" line be told apart from the notes, but not this rule, which drops the phone's edits even once the parser is fixed. ## Done when - Tests in `tests/test_dav.py` that set a description on the phone for an interview with empty notes, and extend one with existing notes, and assert after one run that the notes equal the phone's text, and after a further local change and push that the server's event still carries it.
tiagoagueda added this to the 0.5.0 milestone 2026-10-01 10:47:52 +00:00
Author
Owner

Fixed by pull request #35, merged as fb8bbd7ae.

Fixed by pull request #35, merged as fb8bbd7ae.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo-dav#22
No description provided.