Conversation
…kerError utility to provide clearer error messages. This change improves the reporting of errors during various operations, including fixture advances, refreshes, stats sync, rollovers, and score recomputations. Additionally, update batchUpsertParticipants to handle empty input gracefully and ensure terms acceptance is recorded correctly.
…nd ensure only existing participants are updated. Introduced chunking for wallet address queries to enhance performance and prevent errors during upserts. Added documentation for the new batch processing logic.
…s functions - Introduced a new test file for fantasy participant patching logic. - Added tests to validate merging of duplicate wallet entries and handling of distinct wallets. - Implemented error handling tests for invalid batch sizes in batchUpsertParticipants function. - Enhanced overall test coverage for participant-related operations.
- Added a mock for supabaseAdmin to facilitate testing. - Improved the batchUpsertParticipants test to validate that invalid batch sizes do not trigger database access. - Ensured that the from mock is reset before each test to maintain isolation and accuracy in test results.
- Introduced a new constant to cap in-flight participant updates at 25 to prevent overwhelming the database. - Updated the implementation to process updates in fixed-size groups, improving performance and error handling. - Added unit tests to validate the new concurrency limits and error propagation during updates.
…or-create-new-row Enhance error handling in worker functions
Dprof-in-tech
requested review from
5ran6,
chibie,
onahprosper and
sundayonah
as code owners
August 23, 2026 21:20
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Jira Issue
Jira Issue:
Description
This pull request improves error reporting and participant update logic in the fantasy worker system, and adds comprehensive tests for the new participant patch merging and upsert functionality. The main changes include introducing a utility for formatting errors, refactoring participant patch merging and batch updates to be more robust and efficient, and adding thorough unit tests for these changes.
Error Handling Improvements
formatWorkerErrorutility to provide more readable and informative error messages for worker alerts, replacing generic stringification of errors throughout therunWorkerTickfunction. [1] [2] [3] [4] [5] [6] [7] [8]Participant Patch Merging and Upsert Refactor
ParticipantPatchtype and amergeParticipantPatchesfunction to normalize wallet addresses and merge multiple patches per wallet, ensuring later patches override earlier values.batchUpsertParticipantsto use the new merging logic, resolve canonical wallet addresses before updating, and cap concurrent in-flight updates to 25 per batch for efficiency and safety. [1] [2]Testing Enhancements
fantasy-participant-patches.test.ts) with comprehensive unit tests for bothmergeParticipantPatchesandbatchUpsertParticipants, covering normalization, merging, error handling, and concurrency limits.This fixes the leaderboard no refresh for noblocks play.
Self-review
References
Testing
Staging
Checklist
mainBy submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.