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: added null checks for message.data & pong type checking #1027

Merged
merged 10 commits into from
Jan 27, 2025

Conversation

ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Jan 19, 2025

What does this PR do?

During creation of heartbeat messages in realtime, the response is {"type": "pong"}. It does not contain the data attribute that the code does not account for, leading to error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type 'Null' is not a subtype of type 'Map<dynamic, dynamic>'

This PR adds null-safety checks for message event type in flutter, android, ios, web and react-native. it also makes accounting for pong type consistent.

Test Plan

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes.

templates/swift/Sources/Services/Realtime.swift.twig Outdated Show resolved Hide resolved
templates/web/src/client.ts.twig Outdated Show resolved Hide resolved
templates/react-native/src/client.ts.twig Outdated Show resolved Hide resolved
@ChiragAgg5k ChiragAgg5k requested a review from loks0n January 25, 2025 04:06
@christyjacob4 christyjacob4 merged commit 612b2e0 into master Jan 27, 2025
1 check passed
@ChiragAgg5k ChiragAgg5k deleted the fix-pong-null-safety branch January 27, 2025 16:12
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.

4 participants