Skip to content

ToC related fixes#1453

Open
psilabs-dev wants to merge 4 commits intoDifegue:devfrom
psilabs-dev:bugfix/toc-stuff
Open

ToC related fixes#1453
psilabs-dev wants to merge 4 commits intoDifegue:devfrom
psilabs-dev:bugfix/toc-stuff

Conversation

@psilabs-dev
Copy link
Contributor

Addresses 2 issues raised during code review, which I'll explain below.

Issue 1: add_toc_entry

If an exception happens, (supposedly judging from the code) a basic toc is still passed into Redis. However, an empty hash gets passed into the database, instead of {"page": $title}. Also, otherwise the previous ops on toc wouldn't make much sense.

There's another small issue outside of review. Suppose redis drops while in the try block, then hset will fail and put the process into the catch block. If redis comes back up during the catch block, then LRR will have erased the toc entry due to the database being unstable.

Issue 2: build_json

Since eval code already exists, then we might as well just account for the cases when eval fails.

Eval failure already means that none of the subsequent code should be executed. However, even if decode passes, we should probably check that we have a hash instead of [].

@psilabs-dev psilabs-dev marked this pull request as draft January 23, 2026 04:24
@psilabs-dev psilabs-dev changed the title ToC exception related fixes ToC related fixes Jan 23, 2026
@psilabs-dev psilabs-dev marked this pull request as ready for review January 23, 2026 04:55
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.

1 participant