Repository navigation
[web-shared] Copy BigInt values as decimal strings instead of [object Object] - #5517
Conversation
🦋 Changeset detectedLatest commit: 2acf852 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@debojyoti10CC is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @debojyoti10CC, thanks for the fix! Could you please re-push this with a signed commit? Our repo requires verified signatures on all branches, so we can't run CI against your commit ( The simplest way is SSH signing:
Make sure the commit email matches a verified email on your GitHub account. After pushing, the commit should show a green Verified badge on this PR. GPG signing works too; see GitHub's docs on signing commits. Once it's verified, we'll kick off CI. Thanks! |
… Object] Signed-off-by: debojyoti10CC <debojyotidm4@gmail.com>
0ff1e24 to
2acf852
Compare
|
Thanks @TooTallNate! I set up SSH signing and re-pushed. The commit is now 2acf852 and shows as verified, with the same changes and DCO sign-off as before. |
… Object] (#5517) Copying a step input/output/event payload that contains a BigInt below the top level put `[object Object]` (or `1,2` for arrays) on the clipboard. `serializeForClipboard` called `JSON.stringify(value, null, 2)` with no replacer, so any nested BigInt threw and the catch fell back to `String(value)`. I added a replacer that writes BigInt as a decimal string, the same as the CLI's `stringifyJSON`. A top-level BigInt still copies as the bare number (`10`), as before. Circular objects keep the existing `[object Object]` fallback. I left `formatMetadataValue` in `attributes-block.tsx` alone to keep this small. Fixes #5511 Thanks @abhiramshaji-cyber for the clear report and repro. Signed-off-by: debojyoti10CC <debojyotidm4@gmail.com> Co-authored-by: Peter Wielander <mittgfu@gmail.com> Signed-off-by: Debojyoti De Majumder <debojyotidm4@gmail.com>
|
Backport PR opened against |
|
Thanks @TooTallNate for the review and for the signing steps. The signed commit made the CI run possible, and thanks for merging it. |
Description
Copying a step input/output/event payload that contains a BigInt below the top level put
[object Object](or1,2for arrays) on the clipboard.serializeForClipboardcalledJSON.stringify(value, null, 2)with no replacer, so any nested BigInt threw and the catch fell back toString(value).I added a replacer that writes BigInt as a decimal string, the same as the CLI's
stringifyJSON. A top-level BigInt still copies as the bare number (10), as before. Circular objects keep the existing[object Object]fallback. I leftformatMetadataValueinattributes-block.tsxalone to keep this small.Fixes #5511
Thanks @abhiramshaji-cyber for the clear report and repro.
How did you test your changes?
Updated
packages/web-shared/test/copyable-data-block.test.tswith nested cases ({ amount: 10n },[1n, 2n],{ input: [{ a: { b: 5n } }] }).SyntaxError: "[object Object]" is not valid JSON, 1 failed | 15 passed.PR Checklist - Required to merge
pnpm changesetwas run (patch for@workflow/web-shared)git commit --signoff)@vercel/workflowonce ready