Repository navigation
Migrate the search results warning to the generated model - #6719
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. WalkthroughChangesSearch warning model migration
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The search warning model migration preserves warning data and safely defaults omitted channel-scoping fields, with focused mapper coverage. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. A rabbit hops through models bright Comment |
andremion
left a comment
There was a problem hiding this comment.
Looks good. One small nit inline.
…ssion the wire never makes
|
|
🚀 Available in v7.12.0 |



Goal
Parse the search results warning with the generated
SearchWarning, retiringSearchWarningDto.Part of AND-1291
Implementation
SearchMessagesResponse.resultsWarningat the generated model and migrate its mapper. VendorsSearchWarning, the only model in the closure. Imported under an alias, since the domain type has thesame name.
channel_search_cidsandchannel_search_countat the mapper, which is where the shape changelands.
Notes
Both scoping fields carry
omitemptyon the payload struct, and the generated model has them nullable:In practice both are always sent. The backend only builds the warning when the channel query hits its
500-channel limit, so the CID list is full and the count non-zero whenever a warning exists. The domain
keeps its non-null fields, so the mapper defaults to an empty list and zero, which only matters if that
ever changes.
The other two fields,
warning_descriptionandwarning_code, are plain tags and stay required.Testing
Mutation sweep over
SearchWarning.toDomain: zero survivors, all four fields compile-guaranteed.Added a mapper test for the case where the optional fields are absent.
Device-probed
searchMessages, which returned the probe message and parsed the response with the swappedfield.
results_warningitself is not reachable from a probe: the backend only emits it when channelfilters match more than 500 channels, so it came back null as expected, and the populated shape is covered
by the mapper tests instead.
Summary by CodeRabbit