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 _dispatch_lane_resume crash in RepeatingTimer #2938

Merged
merged 3 commits into from Dec 15, 2023

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Dec 14, 2023

🔗 Issue Links

Resolves https://github.com/GetStream/ios-issues-tracking/issues/676

🎯 Goal

Fixes a crash in RepeatingTimer. The root cause is because of a double resume() call. Although we had protections against this, the reason this still happens very rarely is because this class is called from multiple threads, and so the way to fix it is to make sure the state is accessed in a serial queue.

🧪 Manual Testing Notes

N/A

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero ⚠️ policy (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

Copy link

sonarcloud bot commented Dec 15, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

47 New issues
0 Security Hotspots
91.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

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

LGTM ✅ We should also update the changelog.

Sources/StreamChat/Utils/Timers.swift Show resolved Hide resolved
@nuno-vieira nuno-vieira marked this pull request as ready for review December 15, 2023 13:04
@nuno-vieira nuno-vieira requested a review from a team as a code owner December 15, 2023 13:04
@nuno-vieira nuno-vieira merged commit a16d1d9 into develop Dec 15, 2023
7 checks passed
@nuno-vieira nuno-vieira deleted the fix/crash-repeating-timer-not-thread-safe branch December 15, 2023 13:05
This was referenced Dec 21, 2023
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.

None yet

2 participants