Skip to content

🦞 igor-claw: cross-link Events mainImage SDK read-shape divergence in setup-events.md - #945

Open
ayal wants to merge 1 commit into
mainfrom
igor-claw/events-mainimage-sdk-crosslink
Open

🦞 igor-claw: cross-link Events mainImage SDK read-shape divergence in setup-events.md#945
ayal wants to merge 1 commit into
mainfrom
igor-claw/events-mainimage-sdk-crosslink

Conversation

@ayal

@ayal ayal commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Opened automatically by an AI agent on behalf of Ayal (ayalg@wix.com), from a headless-platform feedback report. Slack thread: https://wix.slack.com/archives/C0BDXM5LLE7/p1786352538961499

A developer seeded an Events V3 event's mainImage per setup-events.md's documented write shape ({id, url, height, width, altText}), confirmed it round-trips via REST, then built the frontend against that same object shape — and got event.mainImage.url === undefined everywhere, with no error anywhere in the stack.

Root cause (confirmed live + in source):

  • PATCH /events/v3/events/{id} with mainImage as the object round-trips correctly via REST (verified against a throwaway test site).
  • But wixEventsV2.getEventBySlug / queryEvents (@wix/events) run that same field through @wix/sdk-runtime's transformRESTImageToSDKImage (see packages/sdk-dependencies/public-sdk/events/wix-events-v-2/src/events-v3-event-wix-events-v-2.public.ts in wix-private/auto-sdk-packages), so event.mainImage comes back as a plain wix:image://v1/<id>/<altText>#originWidth=…&originHeight=… string, not the object. Confirmed by actually calling the published @wix/events SDK against a live test event.
  • This is a deliberate, platform-wide SDK convention (the same one Stores' media.main.image uses, already documented in how-to-code-a-store.md) — not a bug to fix in the API. how-to-code-events.md already documents the correct read-side shape and render helper, but nothing cross-links it from the seed recipe, so an agent that seeds first and builds the frontend off that same object mental model reproduces this by default.

Fix: one cross-reference line in setup-events.md's "Attach images" step, pointing at how-to-code-events.md's existing "Rendering & mounting → Image" note, right where the write shape is shown.

Test plan

  • Docs-only change — no code path affected. Reviewed the added line for accuracy against the live repro (REST PATCH → object; wixEventsV2.getEventBySlug → string).

…-events.md

Confirmed live: PATCH .../events/v3/events/{id} with mainImage as the
{id,url,height,width,altText} object round-trips correctly via REST, but
wixEventsV2.getEventBySlug/queryEvents (@wix/events) run the field through
@wix/sdk-runtime's transformRESTImageToSDKImage, so event.mainImage comes
back as a plain wix:image://... string. Same platform-wide convention as
Stores' media.main.image (already documented in how-to-code-a-store.md) -
not a bug, just missing at the point setup-events.md shows the write shape.
how-to-code-events.md already documents the correct read-side shape, but
nothing cross-links it from the seed recipe, so seeding first and coding
from that same object mental model reproduces a silent "every image
missing" bug with no error anywhere.

Opened automatically by an AI agent on behalf of Ayal (ayalg@wix.com).
Report thread: https://wix.slack.com/archives/C0BDXM5LLE7/p1786352538961499
@ayal
ayal requested a review from ozsay August 10, 2026 09:16
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.

1 participant