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 stop working when switching backend - WPB-15127 #2389

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

netbe
Copy link
Collaborator

@netbe netbe commented Jan 15, 2025

BugWPB-15127 [iOS] Notifications stop working

Issue

When switching backend after logging out from an account and then log to a new account, the NSE will not work because the cookie is invalid.

This is due to the fact that the environmentType (prod, staging,...), although it is correctly saved to applicationGroup UserDefaults for the NSE to work correctly, it does not read from the UserDefaults. Therefore it falls back to production and invalidates the session.

Solution:

Read environmentType from applicationGroup in BackendEnvironment.shared.

Testing

  • See steps in ticket to reproduce

Note: as the code is in a static variable it is hard to add a unit test.


Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

@echoes-hq echoes-hq bot added the echoes: unplanned Any work item that isn’t part of the product or technical roadmap. label Jan 15, 2025
@netbe netbe requested review from a team, samwyndham, caldrian and KaterinaWire and removed request for a team January 15, 2025 16:03
@netbe netbe changed the title fix: read from userdefaults environmentType - WPB-15127 fix: notifications stop working when switching backend - WPB-15127 Jan 15, 2025
Copy link
Contributor

github-actions bot commented Jan 15, 2025

Test Results

    1 files      2 suites   1m 59s ⏱️
1 793 tests 1 767 ✅ 26 💤 0 ❌
1 803 runs  1 777 ✅ 26 💤 0 ❌

Results for commit 982b4ec.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Jan 15, 2025

Datadog Report

Branch report: fix/WPB-15127-notifications-stop-working
Commit report: ee19e83
Test service: wire-ios-mono

✅ 0 Failed, 1689 Passed, 26 Skipped, 1m 59.38s Total Time

@netbe netbe enabled auto-merge January 16, 2025 12:08
@netbe netbe added this pull request to the merge queue Jan 16, 2025
Merged via the queue into develop with commit 601b570 Jan 16, 2025
10 of 11 checks passed
@netbe netbe deleted the fix/WPB-15127-notifications-stop-working branch January 16, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: unplanned Any work item that isn’t part of the product or technical roadmap.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants