Skip to content

Conversation

@eliseier
Copy link
Collaborator

@eliseier eliseier commented Dec 6, 2025

Motivation

(Added: Notion task: Make sure stacktrace shows up for query on MapsPlaceReviewLocalized (likely due to findAllChunked))

When looking through our logs, one of our stacktrace comments came back like this: "/* stacktrace=\n"

It's likely that we accidentally truncated the stacktrace at -1, which included just the final newline, when trying to find a good truncation point for the stacktrace. Instead, we should:

  • double-check to make sure the indexes to cut at are >= 0
  • if we can't find expected string input, include more context (e.g. the whole stack) in order to retain more context so we can at least get good data and iterate on this in the future

Changes

  • Change makeMinimalUsefulStacktrace to take in a string to make it easier to test
  • Change logic to not truncate if the indexes we'd prefer to look for are < 0

Testing

Added new automated test for a string without "node_modules" nor "at" in it. Ran yarn mocha test/util.test.js

@pxpeterxu
Copy link

pxpeterxu commented Dec 6, 2025

Thanks for making this!

Were we actually able to figure out a minimal reproduction where the stacktrace became like this? it sounds like maybe we weren’t — I’m not super-confident that it’ll fix it as a result, and I’m wondering what we’ve already tried. Ideally, there’s a test that would have failed before this change and now passes!

I see you have an interesting hypothesis in your notes:

likely cause: we’re running the code from e.g. a job in a different environment that doesn’t use the V8 stack trace format

Can we somehow simulate that by creating a test queue and a job, and then running it in that? (We do have working stacktraces from jobs, so I’m a bit skeptical of this hypothesis too, and we may want to message/list other hypotheses first, and then go through them systematically until you have a minimal reproduction)

Also, a reminder to link to the Notion task from the GitHub PR/MR! It’s here: Make sure stacktrace shows up for query on MapsPlaceReviewLocalized (likely due to findAllChunked)

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.

3 participants