Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(notifications): use last event instead of oldest when recoverying from 404 [WPB-267] #2039

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 6, 2023

Cherry pick from the original PR:


⚠️ Conflicts during cherry-pick:


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

  • When attempting to fetch the oldest possible event from the api, some issue prevents us from moving on. See WPB-4442.

  • We leave open a time gap between registering client and performing slow-sync until we first fetch the last notification from the backend. Which can lead to some events being lost.

Solutions

  1. Move the responsibility of fetching the last notification from remote outside of the repository, and into slow sync. That now fetches and saves the most recent event IDs after successful workflow if there's no previously processed event ID.
    This follows more closely the general sync documentation.

  2. During incremental sync recovery, clears the last processed event ID and restarts slow sync for Client or EventNotFound failures. Which, as described in 1, will cause the fetching of the last remote event.

  3. Refactored method names to align with these changes for better clarity.

Testing

Tested manually by changing the lastProcessedEventId in the database to some garbage, which led to a 404 and successful recovery.

Test Coverage

  • I have added automated test to this contribution

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

… from 404 [WPB-267] (#2037)

The slow sync process now fetches and saves the most recent event IDs after successful workflow if there's no previously processed event ID. In incremental sync recovery, updated logic now discards all events and restarts slow sync for Client or EventNotFound failures. Refactored method names to align with these changes for better clarity
@github-actions github-actions bot added the cherry-pick PR is cherry-picking changes from another banch label Sep 6, 2023
@github-actions
Copy link
Contributor Author

github-actions bot commented Sep 7, 2023

Unit Test Results

   432 files  ±0     432 suites  ±0   3m 21s ⏱️ + 1m 23s
2 353 tests +2  2 250 ✔️ +2  103 💤 ±0  0 ±0 

Results for commit acf3474. ± Comparison against base commit 01e8e23.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Sep 7, 2023

Datadog Report

All test runs b48a3c6 🔗

2 Total Test Services: 0 Failed, 0 with New Flaky, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-ios 0 0 0 1615 31 10.01s Link
kalium-jvm 0 0 0 2250 103 13m 38s Link

@vitorhugods vitorhugods added this pull request to the merge queue Sep 7, 2023
Merged via the queue into develop with commit 16334db Sep 7, 2023
@vitorhugods vitorhugods deleted the fix/notifications/use-last-event-instead-of-oldest-when-recoverying-from-404-cherry-pick branch September 7, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants