Skip to content

fix(new-quotes): git guards never fire in add, get and refuse (@boergeson) - #8379

Open
boergeson wants to merge 2 commits into
monkeytypegame:masterfrom
boergeson:fix/new-quotes-git-guard
Open

fix(new-quotes): git guards never fire in add, get and refuse (@boergeson)#8379
boergeson wants to merge 2 commits into
monkeytypegame:masterfrom
boergeson:fix/new-quotes-git-guard

Conversation

@boergeson

Copy link
Copy Markdown
Contributor

Description

tryCatchSync returns data: null when the callback throws, so the git guards in add, get and refuse that compare against undefined never fire. Only approve was updated to null in #6492. With no quotes repo checked out those three just run as if git was there.

Changed the three checks to === null. Added a spec that mocks simple-git to throw, on master add/get/refuse pass through, with this change all four throw the 500.

Note the issue describes it the other way round (says approve is the broken one), but approve is the only one that was right, see packages/util/src/trycatch.ts.

Closes #8364

@monkeytypegeorge monkeytypegeorge added the backend Server stuff label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Server stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug (backend): dead null check in newQuotes.approve() — git === null never true, git init failure crashes with raw TypeError

2 participants