Skip to content

fix: improve disposal timeout handling for Firestore slowness#17

Merged
koistya merged 1 commit intomainfrom
dev
Nov 3, 2025
Merged

fix: improve disposal timeout handling for Firestore slowness#17
koistya merged 1 commit intomainfrom
dev

Conversation

@koistya
Copy link
Member

@koistya koistya commented Nov 3, 2025

Summary

Refactored Promise.race() logic to handle slow in-flight gRPC calls and improve Firestore disposal reliability:

  • Refactor Promise.race() to properly handle slow in-flight gRPC calls
  • Pre-attach error handler to catch late rejections from aborted promises
  • Add Firestore emulator health check to CI workflow (wait for port 8080)
  • Adjust test timeouts for Firestore emulator reliability
  • Enhance documentation of timeout behavior across backends

This ensures disposal never blocks indefinitely while allowing background RPCs to complete naturally. Errors from delayed operations are routed through onReleaseError callback for observability.

Changes

  • .github/workflows/integration.yml - Add Firestore emulator health check before running tests
  • common/disposable.ts - Improved Promise.race() implementation with better error handling and documentation
  • package.json - Version bump to 2.5.1
  • test/integration/disposable.test.ts - Adjusted test timeouts and added polling logic for Firestore

Test Plan

  • All unit tests pass
  • Integration tests pending (Firestore timeouts being addressed)
  • Type checking passes
  • Code formatting is correct

- Refactor Promise.race() to handle slow in-flight gRPC calls
- Pre-attach error handler to catch late rejections from aborted promises
- Add Firestore emulator health check to CI workflow
- Adjust test timeouts for Firestore emulator reliability
- Enhance documentation of timeout behavior across backends

This ensures disposal never blocks indefinitely while allowing background
RPCs to complete naturally. Errors from delayed operations are routed
through onReleaseError callback for observability.
@koistya koistya merged commit 4c3597f into main Nov 3, 2025
7 checks passed
@koistya koistya deleted the dev branch November 3, 2025 13:55
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.

1 participant