Skip to content

Commit 95ae33f

Browse files
exaby73taeold
andauthored
fix: retry param ignored for RTDB triggers (#1588)
* fix: retry param ignored for RTDB triggers * Remove console.log * feat: Default to false * test: Add test for retry * chore: Remove formatting changes * Add changelog. --------- Co-authored-by: Daniel Lee <[email protected]> Co-authored-by: Daniel Lee <[email protected]>
1 parent e37645a commit 95ae33f

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Expose retry configuration in v2 RTDB trigger (#1588)

spec/v2/providers/database.spec.ts

+34
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,40 @@ describe("database", () => {
280280
},
281281
});
282282
});
283+
284+
it("should supply retry", () => {
285+
const func = database.onChangedOperation(
286+
database.writtenEventType,
287+
{
288+
ref: "/foo/{path=**}/{bar}/",
289+
instance: "my-instance",
290+
region: "us-central1",
291+
cpu: "gcf_gen1",
292+
minInstances: 2,
293+
retry: true,
294+
},
295+
() => 2
296+
);
297+
298+
expect(func.__endpoint).to.deep.equal({
299+
...MINIMAL_V2_ENDPOINT,
300+
platform: "gcfv2",
301+
cpu: "gcf_gen1",
302+
minInstances: 2,
303+
region: ["us-central1"],
304+
labels: {},
305+
eventTrigger: {
306+
eventType: database.writtenEventType,
307+
eventFilters: {
308+
instance: "my-instance",
309+
},
310+
eventFilterPathPatterns: {
311+
ref: "foo/{path=**}/{bar}",
312+
},
313+
retry: true,
314+
},
315+
});
316+
});
283317
});
284318

285319
describe("onOperation", () => {

src/v2/providers/database.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ export function makeEndpoint(
447447
eventType,
448448
eventFilters,
449449
eventFilterPathPatterns,
450-
retry: false,
450+
retry: opts.retry ?? false,
451451
},
452452
};
453453
}

0 commit comments

Comments
 (0)