Repository navigation
fix(database): hash prioritized children in priority order - #16769
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
Agent claims the existing behavior is inconsistent with Android and Web |
|
Thanks for the contribution! A few housekeeping items:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request fixes the node hashing logic in FChildrenNode.m to correctly use priority order when all children have priorities, by ensuring the check for non-empty priorities is properly negated. A corresponding unit test has been added to verify this behavior. The reviewer suggested a minor improvement to the loop in FChildrenNode.m to use an explicit if statement for better readability and to avoid redundant boolean assignments.
paulb777
left a comment
There was a problem hiding this comment.
Thanks, nice catch. Because the check is inverted, a node whose children all have priorities is hashed in key order instead of priority order. That doesn't match the server, or the Android and JS SDKs. The hash is sent with transactions and listens, so transactions on such data can fail with maxretry, and listens re-download data the client already has. The one-character fix matches Android's ChildrenNode.getHashRepresentation.
Optional CHANGELOG wording: - [fixed] Fixed an issue where transactions could fail with a maxretry error when every child of a node had a priority. (#16769)
|
Added the literal JS-algorithm golden Moved the changelog to Unreleased/#16769 using the suggested maxretry wording. Changed Objective-C files were formatted with clang-format 23.1.2 and git diff --check passes. Native Apple XCTest remains unrun locally and requires current-head CI. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where transactions could fail with a maxretry error when every child of a node has a priority. The fix corrects the logic in FChildrenNode.m to ensure sawPriority is set to true when a child node's priority is not empty. A corresponding unit test has been added to verify that the children node hash correctly uses priority order. There are no review comments, and I have no feedback to provide.
Summary
Validation