dosubot[bot] commented on issue #39006: URL: https://github.com/apache/superset/issues/39006#issuecomment-4169819088
<!-- Answer --> That plan sounds solid! A few things to keep in mind as you work on the PR: 1. **DeckGL duplicate is functionally identical** — confirmed. The only differences are cosmetic: it uses `JsonObject` instead of `any` for the parameter type and names the catch variable `error` instead of `err` [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils/safeStringify.ts). Apply the same three changes (JSDoc update, `console.warn`, `return '[Circular]'`) there as well. 2. **Consider consolidating the duplication** — since the two implementations are nearly identical, it might be worth having the DeckGL plugin import `safeStringify` from `@superset-ui/core` or the shared utils instead of maintaining its own copy. That's a separate concern from your fix, but worth mentioning in the PR description as a potential follow-up. 3. **Tests** — check if there are existing tests for `safeStringify` (likely in a `safeStringify.test.ts` file nearby) and add a test case that verifies a circular reference produces a `'[Circular]'` marker in the output rather than omitting the key. 4. **`console.warn` note** — make sure the warning message is clear but not too noisy, since this could fire in production. Something like `console.warn(\`Circular reference detected and replaced with '[Circular]' placeholder (key: "${key}")`)` should be sufficient. Looking forward to your PR! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=733c3cbe-0deb-4f8e-abca-6b09d640f012&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=733c3cbe-0deb-4f8e-abca-6b09d640f012&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=733c3cbe-0deb-4f8e-abca-6b09d640f012&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=733c3cbe-0deb-4f8e-abca-6b09d640f012&feedback_type=too_verbose) | [Hallucination](https:// app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=733c3cbe-0deb-4f8e-abca-6b09d640f012&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=733c3cbe-0deb-4f8e-abca-6b09d640f012&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=733c3cbe-0deb-4f8e-abca-6b09d640f012&feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=That%20plan%20sounds%20solid%21%20A%20few%20things%20to%20keep%20in%20mind%20as%20you%20work%20on%20the%20PR%3A%0A%0A1.%20%2A%2ADeckGL%20duplicate%20is%20functionally%20identical%2A%2A%20%E2%80%94%20confirmed.%20The%20only%20differences%20are%20cosmetic%3A%20it%20uses%20%60JsonObject%60%20instead%20of%20%60any%60%20for%20the%20parameter%20type%20and%20names%20the%20catch%20variable%20%60error%60%20instead%20of%20%60err%60%20%5B%5B1%5D%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utils/safeStringify.ts%29.%20Apply%20the%20same%20three%20changes%20%28JSDoc%20update%2C%20%60cons ole.warn%60%2C%20%60return%20%27%5BCircular%5D%27%60%29%20there%20as%20well.%0A%0A2.%20%2A%2AConsider%20consolidating%20the%20duplication%2A%2A%20%E2%80%94%20since%20the%20two%20implementations%20are%20nearly%20identical%2C%20it%20might%20be%20worth%20having%20the%20DeckGL%20plugin%20import%20%60safeStringify%60%20from%20%60%40superset-ui/core%60%20or%20the%20shared%20utils%20instead%20of%20maintaining%20its%20own%20copy.%20That%27s%20a%20separate%20concern%20from%20your%20fix%2C%20but%20worth%20mentioning%20in%20the%20PR%20description%20as%20a%20potential%20follow-up.%0A%0A3.%20%2A%2ATests%2A%2A%20%E2%80%94%20check%20if%20there%20are%20existing%20tests%20for%20%60safeStringify%60%20%28likely%20in%20a%20%60safeStringify.test.ts%60%20file%20nearby%29%20and%20add%20a%20test%20case%20that%20verifies%20a%20circular%20reference%20produces%20a%20%60%27%5BCircular%5D%27%60%20marker%20in%20the%20output%20rather%20than%20omitting%20the%20key.%0A%0A4.%20%2A%2A%60console.warn%60%20note%2A%2A%2 0%E2%80%94%20make%20sure%20the%20warning%20message%20is%20clear%20but%20not%20too%20noisy%2C%20since%20this%20could%20fire%20in%20production.%20Something%20like%20%60console.warn%28%5C%60Circular%20reference%20detected%20and%20replaced%20with%20%27%5BCircular%5D%27%20placeholder%20%28key%3A%20%22%24%7Bkey%7D%22%29%60%29%60%20should%20be%20sufficient.%0A%0ALooking%20forward%20to%20your%20PR%21) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/39006) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
