Page MenuHomePhabricator

bug: error on review when publishing
Closed, ResolvedPublic

Description

bug: an error appears when I click review in the list of files to be published.

"Something broke
Cannot read properties of undefined (reading 'value')"

Related Objects

Event Timeline

MR: https://gitlab.wikimedia.org/daanvr/upload-workbench/-/merge_requests/46
Preview: https://upload-workbench.toolforge.org/mr-46/

Root cause: bulkPublishClaimSummary in src/ui/bulk-publish-modal.jsx blindly read c.mainsnak.datavalue.value for every claim, but buildSdcClaims emits the P170 (creator) self-author claim as a somevalue mainsnak with no datavalue (the username lives in the P4174 qualifier). Any row where the user is the canonical self-author crashed Review and tripped the top-level ErrorBoundary ("Something broke").

Fix: mirror the safer shape used by PublishModal's ClaimSummary — branch on snaktype === 'somevalue' first (rendering the username from the P4174 qualifier), then optional-chain datavalue?.value for the value-typed snaks, with a fallback so unexpected snak shapes degrade to a label instead of crashing.

Verification: build passes (including the undefined-refs scanner), CI deploy:mr succeeded, the preview at the URL above loads with the correct /mr-46/ base path, and the deployed bundle contains the new snaktype === 'somevalue' + datavalue?.value guards (grep-confirmed against the served JS). I could not run an OAuth login as a real user from my agent environment to click Review on the live preview — would appreciate a quick eyeball on a row where you are the self-author before merging.