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(fcm): Wrap HTTP/2 session errors in promise #2868

Merged
merged 8 commits into from
Mar 18, 2025
Merged

Conversation

jonathanedey
Copy link
Contributor

@jonathanedey jonathanedey commented Mar 10, 2025

RELEASE NOTE: Fixed a issue which caused session errors not to be thrown.

  • Promise wrapped HTTP/2 session errors allowing them to be caught as a FirebaseMessagingSessionError
  • Added pendingBatchResponse field to new FirebaseMessagingSessionError to allow access to the status of messages which were in flight at error time.

@jonathanedey jonathanedey added the release:stage Stage a release candidate label Mar 10, 2025
@jonathanedey jonathanedey marked this pull request as ready for review March 11, 2025 18:38
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

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

Thanks Jonathan! Added one comment

// Start session listeners
http2SessionHandler.invoke().catch((error) => {
const pendingBatchResponse =
sendResponsePromise ? sendResponsePromise.then(this.parseSendResponses) : undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Just thinking out loud, if a session error occurs before any of the requests have gone through would pendingBatchResponse be undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this would be undefined.

@jonathanedey jonathanedey merged commit d0d40bf into master Mar 18, 2025
8 checks passed
@jonathanedey jonathanedey deleted the je-http2-error branch March 18, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:stage Stage a release candidate release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants