Skip to content

Refactoring#33

Merged
shieldss merged 1 commit into
mainfrom
dev
Apr 8, 2026
Merged

Refactoring#33
shieldss merged 1 commit into
mainfrom
dev

Conversation

@shieldss

@shieldss shieldss commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Refactor for log errors and API handling

Refactor for log errors and API handling
@shieldss shieldss merged commit c1c45c0 into main Apr 8, 2026
4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cfffbc68ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread public/refile/check.php
Comment on lines +143 to +144
if ($xml === false) {
echo "<div class='alert alert-danger mt-3 text-center'>Item record does not exist</div>";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Distinguish Alma API failures from missing item records

This branch reports "Item record does not exist" whenever no candidate lookup succeeds, but the loop also reaches that path on transport/API failures (timeouts, DNS, 5xx), because almaGetXml() errors are discarded. In those cases users get a false “missing item” result for valid barcodes and may take incorrect operational actions; please surface the last HTTP/cURL error (or at least a separate API-failure message) before falling back to not-found.

Useful? React with 👍 / 👎.

Comment on lines +539 to +540
if ($jsonLine !== false) {
file_put_contents($file, $jsonLine . "\n", FILE_APPEND | LOCK_EX);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail loudly when NDJSON audit writes do not persist

The refactor now ignores file_put_contents() failures (and only guards JSON encoding), so batch updates can be shown as successful while audit rows are silently dropped from refile.ndjson. This regresses traceability compared to the prior behavior that aborted on write errors; at minimum, check the write return value and report an error so operators know logging failed.

Useful? React with 👍 / 👎.

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