1.154.0 by Claude#61
Conversation
|
|
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:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| user_id=requester.user, | ||
| event_id=event_id, | ||
| thread_id=thread_id, | ||
| extra_content=body, |
There was a problem hiding this comment.
Receipt payload pollution + client-controllable ts. Passing the entire request body as extra_content means the receipt data computed in handlers/receipts.py:198-201 becomes {"ts": int(self.clock.time_msec()), **body} — so:
thread_id(already pulled out and passed separately) ends up duplicated inside the receipt content.com.beeper.allow_backward(a protocol flag, not user-visible data) is stored and federated as part of the receipt.- Any client can set
tsin the body and override the authoritative server-generated timestamp, which other servers/clients will then see as truth.
The companion synapse/rest/client/read_marker.py:109,119 already handles this correctly by reading from a Beeper-namespaced sub-object:
extra_content=body.get("com.beeper.fully_read.extra", None),
...
extra_content=body.get("com.beeper.read.extra", None),Mirror the same pattern on both branches here (line 134 for FULLY_READ, line 143 for the regular receipts path).
| extra_content=body, | |
| extra_content=body.get("com.beeper.read.extra", None), |
| user_id, room_id, "com.beeper.inbox.done", done | ||
| ) | ||
| logger.info( | ||
| f"SetBeeperDone done_delta_ms={delta_ms} at_order={body.get('at_order')}" |
There was a problem hiding this comment.
Log statement reads the wrong path. Commit d493df2ed ("Look for done.at_order in the correct place in inbox_state endpoint") moved the real lookup to body["done"]["at_order"] two lines above, but this log line was left reading body.get('at_order') at the top level. As a result it always prints at_order=None, which defeats the whole purpose of the debug line. Use body['done'].get('at_order') to match the lookup.
| f"SetBeeperDone done_delta_ms={delta_ms} at_order={body.get('at_order')}" | |
| logger.info( | |
| f"SetBeeperDone done_delta_ms={delta_ms} at_order={body['done'].get('at_order')}" | |
| ) |
| logger.info("No user counts aggregated") | ||
| return 0 | ||
|
|
||
| max_stream_ordering = max(orders) |
There was a problem hiding this comment.
Latent: binds a tuple into a BIGINT column when the experimental flag is enabled. txn yields rows as sequences, so orders looks like [(123,), (456,), ...]. max(orders) therefore returns (456,), and the parameter list two lines below — (max_stream_ordering,) — ends up as ((456,),), binding a tuple where the SQL expects a scalar BIGINT. The resulting OperationalError is swallowed by the except block lower down, so the beeper_user_notification_counts_stream_ordering watermark would silently fail to advance and the aggregation would never make progress.
Gated on experimental.beeper_user_notification_counts_enabled (default False) and pre-existing since beeper-1.140, so production isn't hit today — flagging because the rebase keeps it in 1.154. Fix is one line:
max_stream_ordering = max(order[0] for order in orders)| max_stream_ordering = max(orders) | |
| max_stream_ordering = max(order[0] for order in orders) |
|
|
||
| if should_update: | ||
| content = {"event_id": event_id} | ||
| content = content = {"event_id": event_id, **(extra_content or {})} |
There was a problem hiding this comment.
Typo: content = content = {...}. Python evaluates the RHS once and assigns to content twice — no behavior change, just drop the duplicate assignment.
| content = content = {"event_id": event_id, **(extra_content or {})} | |
| content = {"event_id": event_id, **(extra_content or {})} |
Annoying! Will lave that to upstream and we'll get updates as we rebase.
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
Still broken because the opentracing module upstream uses has long been retried and setuptools broke it.
- reduce hardcoded task parallelism - add hardcoded post task sleep
a22f8da to
ac821ab
Compare
ac821ab to
a55d17f
Compare
No description provided.