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 retry in event triggers #1463

Merged
merged 5 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Fix retry in event triggered functions. (#1463)
- Expose retry configuration in v2 RTDB trigger (#1588)
2 changes: 1 addition & 1 deletion src/v2/providers/alerts/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export function getEndpointAnnotation(
eventFilters: {
alerttype: alertType,
},
retry: !!opts.retry,
retry: opts.retry ?? false,
},
};
if (appId) {
Expand Down
2 changes: 1 addition & 1 deletion src/v2/providers/eventarc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export function onCustomEventPublished<T = any>(
eventTrigger: {
eventType: opts.eventType,
eventFilters: {},
retry: false,
retry: opts.retry ?? false,
channel,
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/v2/providers/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ export function makeEndpoint(
eventType,
eventFilters,
eventFilterPathPatterns,
retry: !!opts.retry,
retry: opts.retry ?? false,
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/v2/providers/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export function onMessagePublished<T = any>(
eventTrigger: {
eventType: "google.cloud.pubsub.topic.v1.messagePublished",
eventFilters: { topic },
retry: false,
retry: opts.retry ?? false,
},
};
copyIfPresent(endpoint.eventTrigger, opts, "retry", "retry");
Expand Down
2 changes: 1 addition & 1 deletion src/v2/providers/remoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function onConfigUpdated(
eventTrigger: {
eventType,
eventFilters: {},
retry: !!optsOrHandler.retry,
retry: optsOrHandler.retry ?? false,
},
};
func.__endpoint = ep;
Expand Down
2 changes: 1 addition & 1 deletion src/v2/providers/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ export function onOperation(
eventTrigger: {
eventType,
eventFilters: { bucket },
retry: false,
retry: opts.retry ?? false,
},
};
copyIfPresent(endpoint.eventTrigger, opts, "retry", "retry");
Expand Down
1 change: 1 addition & 0 deletions src/v2/providers/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export function onTaskDispatched<Args = any>(
convertInvoker
);
convertIfPresent(func.__endpoint.taskQueueTrigger, opts, "invoker", "invoker", convertInvoker);
copyIfPresent(func.__endpoint.taskQueueTrigger, opts, "retry", "retry");

func.__requiredAPIs = [
{
Expand Down
2 changes: 1 addition & 1 deletion src/v2/providers/testLab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export function onTestMatrixCompleted(
eventTrigger: {
eventType,
eventFilters: {},
retry: !!optsOrHandler.retry,
retry: optsOrHandler.retry ?? false,
},
};
func.__endpoint = ep;
Expand Down
Loading