Skip to content

feat: add retry support for firestore, storage and realtime database#298

Open
IzaakGough wants to merge 1 commit into
mainfrom
@invertase/feat-add-retry-for-storage-firestore-database
Open

feat: add retry support for firestore, storage and realtime database#298
IzaakGough wants to merge 1 commit into
mainfrom
@invertase/feat-add-retry-for-storage-firestore-database

Conversation

@IzaakGough

@IzaakGough IzaakGough commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #165

This PR maintains parity between the Python and JavaScript SDKs by adding retry support for Storage, Firestore, and Realtime Database.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates StorageOptions, DatabaseOptions, and FirestoreOptions to inherit from EventHandlerOptions instead of RuntimeOptions, allowing the retry configuration to be dynamically set. Corresponding unit tests have been added to verify this behavior. Feedback suggests simplifying the _endpoint method in StorageOptions by leveraging super()._endpoint directly now that it inherits from EventHandlerOptions.

Comment on lines 938 to 948
event_trigger = _manifest.EventTrigger(
eventType=kwargs["event_type"],
retry=False,
retry=self.retry if self.retry is not None else False,
eventFilters=event_filters,
)

kwargs_merged = {
**_dataclasses.asdict(super()._endpoint(**kwargs)),
**_dataclasses.asdict(RuntimeOptions._endpoint(self, **kwargs)),
"eventTrigger": event_trigger,
}
return _manifest.ManifestEndpoint(**_typing.cast(dict, kwargs_merged))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Since StorageOptions now inherits from EventHandlerOptions, you can simplify _endpoint by calling super()._endpoint directly. This avoids manually constructing the EventTrigger and merging dictionaries, leveraging the base class implementation as intended.

        return super()._endpoint(**kwargs, event_filters=event_filters)

@IzaakGough IzaakGough marked this pull request as ready for review June 22, 2026 14:52
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.

Missing retry in storage and firestore trigger decorators

2 participants