Repository navigation
fix(storage-resize-images): publish the 1st gen context on onCompletion - #3279
Open
IzaakGough wants to merge 3 commits into
Open
IzaakGough wants to merge 3 commits into
IzaakGough wants to merge 3 commits into
Conversation
The kit published a context built from the 2nd gen event, so resource.name was missing. It now rebuilds the context the extension published.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a helper function toEventContext to map 2nd gen StorageEvent data to the 1st gen EventContext format, ensuring compatibility for completion events. The implementation was updated in handlers.ts and corresponding tests were added and updated to verify the context reconstruction. I have included a suggestion to improve the robustness of the toEventContext function by using optional chaining and nullish coalescing to handle potentially malformed event data safely.
IzaakGough
marked this pull request as ready for review
October 26, 2026 11:39
CorieW
reviewed
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3266.
The kit's
onCompletionevent had nocontext.resource.name, so a subscriber couldn't tell which upload finished.This publishes
contextin the extension's shape, including the object path.subjectis added. The extension never set one, so this keeps strict parity for now.eventIdandtimestampmatch the extension's format, not its values. The extension read them from a separate delivery of the storage notification, which the kit doesn't receive.Tested with unit tests built from a real storage event and the extension's matching
onCompletion, and a live deploy.