Skip to content

feat(protocol): project historical bot web widgets to messageMediaUnsupported - #6

Merged
iamxvbaba merged 2 commits into
iamxvbaba:mainfrom
roon9e:feat/legacy-widget-media
Nov 7, 2026
Merged

iamxvbaba merged 2 commits into
iamxvbaba:mainfrom
roon9e:feat/legacy-widget-media

Conversation

@roon9e

@roon9e roon9e commented Nov 7, 2026

Copy link
Copy Markdown

A Layer 233 messageMediaWidget has no wire identity before Layer 233. The generic new-only policy dropped the media, so a widget-only message reached a 225-232 client as an empty text message. Project it to messageMediaUnsupported#9f84f49e instead.

This is a follow-up to #5 (Layer 233). The sparse codec previously had no family-level project hook, so the generator emitted a call to a generic object encoder it never generated; the family body now keeps the drop behavior and only the project function calls the typed hook (the class/object dispatcher applies it before dispatch).

  • policy: messageMediaWidget new-only -> LayerResolveProject + layerProjectLegacyWidgetMedia for 225-232 (policy.json 305 -> 313 entries)
  • tlprofile/adapters.go: layerProjectLegacyWidgetMediaProject
  • gen/layer_codec_model.go: fix family project emit for the sparse codec
  • regen tlprofile sidecar + projection test; docs record the projection

…upported

A Layer 233 messageMediaWidget has no wire identity before Layer 233. The
generic new-only policy dropped the media, so a widget-only message reached a
225-232 client as an empty text message. Project it to
messageMediaUnsupported#9f84f49e instead, so the older client renders an explicit
unsupported-media placeholder.

- gen/layer_real_policy_test.go: resolve the messageMediaWidget new-only
  obligation for 225-232 with LayerResolveProject + hook
  layerProjectLegacyWidgetMedia (was the default drop). policy.json grows from
  305 to 313 entries (eight layers).
- tlprofile/adapters.go: layerProjectLegacyWidgetMediaProject returns the widget
  unchanged for 233 and MessageMediaUnsupported for older profiles.
- gen/layer_codec_model.go: a family project hook is applied by the class/object
  dispatcher before the family body is encoded, so the family body must not
  re-enter a generic object encoder (which would need runtime dynamic dispatch,
  forbidden by the sparse codec). Emit the drop behavior in the family body and
  keep the hook only in the project function. This is the first family-level
  project hook, so the previous emit referenced an object encoder the sparse
  model never generated.
- Regenerate the tlprofile sidecar (families/runtime) and add a projection test.
- Docs: README + LAYER233_REVIEW record the projection and the 313-entry policy.
go generate ./... was not re-run when the Layer 232/233 constructors landed, so
the entity/styling/typing builders and the cached query wrappers were stale
(missing messageEntityTonAddress, the draft can_stop/keep_on_stop fields,
sendMessageStopDraft and the widget/welcome cached queries). Regenerate them so
make generate is clean.
@iamxvbaba
iamxvbaba merged commit 8cfe1d4 into iamxvbaba:main Nov 7, 2026
11 checks passed
roon9e added a commit to roon9e/gramsrv that referenced this pull request Nov 7, 2026
v1.9.0 carries the Layer 233 historical widget projection (PR iamxvbaba/td#6):
messageMediaWidget now encodes to messageMediaUnsupported for exact profiles
225-232. The layer-225-232 projection test is green against it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants