Map invisible to null when the wire omits it - #6673
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. WalkthroughThe parser now preserves ChangesUser invisible nullability
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to Users other than the connected user will now retain an unknown visibility value when the server omits the field, while explicit visibility and the boolean convenience behavior remain unchanged; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description covers the goal, implementation, consumer impact, and testing. It explains the API behavior, affected parse paths, storage behavior, and test coverage. The UI, checklist, and GIF template sections are omitted, but they are not critical for this non-UI change.
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
andremion
left a comment
There was a problem hiding this comment.
Looks good. Two nits inline, plus one scope question.
The DB entity and the outgoing user requests still flatten this to false. Any plan to follow up on those, or not worth it while nothing in the SDK reads the field?
…le is own-user only
|
On the scope question: neither is changed by this PR, but they are worth separate follow-ups for different reasons. Outgoing requests are unaffected here, because both The DB entity is the one with a visible consequence. Happy to file both, or to pull the DB one into this PR if you would rather not leave the asymmetry in place at all. |
|
|
Both as follow-ups sounds right. The destructive migration decides it for me: batching the nullable column with the next users-table change is better than spending a cache wipe on a field whose only reader in the SDK is Same for the request side, changing what we send does not belong in a parse-path PR. |
|
🚀 Available in v7.10.0 |



Goal
invisibleis only ever sent for the connected user. The backend marks itignore_if_client_sideon the shared user payload and declares it unconditionally only on the own-user response, so for every other user the field never reaches a client-side SDK.The hand-written DTOs defaulted it to
falseregardless, asserting something the server did not send. Endpoints already migrated to the generatedUserResponsereturnnull, because the generated model has no such field. The two parse paths disagreed on the same payload, and the disagreement is observable: the same message parsed over HTTP and over the websocket produced users differing on this field.Closes AND-1458
Implementation
DownstreamUserDto.invisibleand the directUserAdaptertonullrather thanfalse, so all parse paths agree with the wire.invisibletonull. Fixtures that do send it are unchanged:UserTestData.expectedAllFields(true),expectedWithExplicitNulls(null), and the event fixtures, whose JSON carries the field.Consumer impact
User.invisiblereturnsnullinstead offalsefor any user other than the connected one. The declared type is unchanged (Boolean?) and the API diff is empty.User.isInvisibleisinvisible == true, so it still returnsfalseand code using the accessor is unaffected.UserEntity.invisibleis non-null and written fromisInvisible, so a user read back from the database reportsfalse.invisibleordersnullbeforefalse, asgetComparableFieldexposes the raw nullable.Testing
invisiblefrom the connect payload, while members, reads, message senders, poll voters and poll creators across three channels all reportnull.falsefails 22 tests, so the value is pinned on both the DTO and the direct parse path.UserTestDatacovers the three wire cases explicitly: field sent astrue, sent asnull, and absent.Summary by CodeRabbit
Bug Fixes
invisiblefield is omitted.nullinstead of being incorrectly interpreted asfalse.Tests