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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,3 +1,4 @@
- Remove HTTP server shutdown message. (#1457)
- Add features to task queue functions. (#1423)
- Add traces to V2 Firestore trigger logs. (#1440)
- Fix retry in event triggered functions. (#1463)
2 changes: 1 addition & 1 deletion src/v2/providers/alerts/alerts.ts
Expand Up @@ -249,7 +249,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/database.ts
Expand Up @@ -446,7 +446,7 @@ export function makeEndpoint(
eventType,
eventFilters,
eventFilterPathPatterns,
retry: false,
retry: opts.retry || false,
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/v2/providers/eventarc.ts
Expand Up @@ -216,7 +216,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
Expand Up @@ -426,7 +426,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
Expand Up @@ -344,7 +344,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
Expand Up @@ -145,7 +145,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
Expand Up @@ -603,7 +603,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
Expand Up @@ -281,6 +281,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
Expand Up @@ -206,7 +206,7 @@ export function onTestMatrixCompleted(
eventTrigger: {
eventType,
eventFilters: {},
retry: !!optsOrHandler.retry,
retry: optsOrHandler.retry || false,
},
};
func.__endpoint = ep;
Expand Down