Repository navigation
fix(analytics): report errors from every request batch in track_batch/import_batch - #296
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
track_batchandimport_batchsplit the events into request batches whenmax_concurrent_requestsis set, or whenmax_batch_sizeis greater than 50. Each request batch reported its errors to the next step, but only the last request batch's errors reached the user callback. A failure in an earlier request batch was dropped, and the callback could receivenulleven though events were rejected.This change collects the errors from every request batch and passes the combined list to the callback. The callback still receives
nullwhen every request succeeds, so the existing contract is unchanged.The
resultsargument still comes from the last request batch, as before. Its entries are alwaysundefined, so this change leaves it alone to keep the diff small.Testing
passes errors from every request batch to callbacktotest/track.js(max_concurrent_requests: 1) andtest/import.js(max_batch_size: 100). In each test the first request fails and the rest succeed.null. With the fix, both pass.npm test: 489 + 56 tests pass.npm run lintandnpm run check-formatare clean (the one existing lint warning is in the openfeature package tests).Fixes #295