Skip to content

[codex] fix euid_details hidden-section submits#222

Merged
iamh2o merged 3 commits intomainfrom
codex/fix-euid-details-hidden-submit
Apr 4, 2026
Merged

[codex] fix euid_details hidden-section submits#222
iamh2o merged 3 commits intomainfrom
codex/fix-euid-details-hidden-submit

Conversation

@iamh2o
Copy link
Copy Markdown
Contributor

@iamh2o iamh2o commented Apr 4, 2026

Summary

  • fix /save_json_addl_key so hidden-section submits on euid_details accept empty JSON payloads and preserve intended HTTP errors
  • initialize obj.json_addl when absent before writing into properties or controlled_properties
  • add GUI endpoint regressions for empty payload saves, controlled-properties saves, and missing-object 404 behavior

Root Cause

The hidden-section editors on /euid_details post through /save_json_addl_key. That route treated empty {} payloads as missing because it used truthiness checks, and it converted intended HTTPException responses into generic 500s.

Impact

Edit Properties and Edit Template Form submits now succeed for valid payloads and return honest errors when the target object is missing.

Validation

  • source ./activate xxyyzz && python -m pytest --no-cov tests/test_gui_endpoints.py -k save_json_addl_key
  • source ./activate xxyyzz && python -m ruff check tests/test_gui_endpoints.py

Copy link
Copy Markdown

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

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: 9ad25d18a7

ℹ️ 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 on lines +885 to +886
if not isinstance(obj.json_addl, dict):
obj.json_addl = {}
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 Avoid clobbering non-null json_addl payloads

The new guard in save_json_addl_key resets obj.json_addl to {} for any non-dict value, which means a legacy or string-encoded JSON payload will be silently replaced and then committed when users submit hidden-section edits. Because other code paths explicitly handle string-backed json_addl (for example _container_event_payload in api/v1/containers.py), this can cause real metadata loss on existing records instead of just initializing missing data. Initialize only when json_addl is None (or parse known legacy formats) to avoid destructive writes.

Useful? React with 👍 / 👎.

@iamh2o iamh2o merged commit 1a555d5 into main Apr 4, 2026
5 checks passed
@iamh2o iamh2o deleted the codex/fix-euid-details-hidden-submit branch April 6, 2026 16:58
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