Skip to content

Comments

Fix: handle both recipe path and json body requests #449

Open
rugeli wants to merge 1 commit intofeature/server-passed-recipe-jsonfrom
fix/dedup-nonbody
Open

Fix: handle both recipe path and json body requests #449
rugeli wants to merge 1 commit intofeature/server-passed-recipe-jsonfrom
fix/dedup-nonbody

Conversation

@rugeli
Copy link
Collaborator

@rugeli rugeli commented Feb 19, 2026

Problem

in feature/server-passed-recipe-json, we replaced uuid.uuid4() with dedup_hash as the job id. when a recipe path is sent, body is none, causing issues in generating dedup_hash

Solution

  • use dedup_hash as job_id only for body requests, fall back to uuid for recipe path requests

###behaviors:

  1. recipe path request:
  • job_id = uuid, no dedup
  • matches the behavior on main
  • return {"jobId": "uuid string"}
  1. json body request:
  • job_id = dedup_hash
  • dedup check via job_exists() before packing
  • if body is new --> pack
  • return {"jobId": "sha hash..."}

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Comment on lines +62 to +68
if body:
dedup_hash = DataDoc.generate_hash(body)
if self.job_exists(dedup_hash):
return web.json_response({"jobId": dedup_hash})
job_id = dedup_hash
else:
job_id = str(uuid.uuid4())
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only key lines

@github-actions
Copy link
Contributor

Packing analysis report

Analysis for packing results located at cellpack/tests/outputs/test_spheres/spheresSST

Ingredient name Encapsulating radius Average number packed
ext_A 25 236.0

Packing image

Packing image

Distance analysis

Expected minimum distance: 50.00
Actual minimum distance: 50.01

Ingredient key Pairwise distance distribution
ext_A Distance distribution ext_A

@rugeli rugeli requested a review from ascibisz February 19, 2026 22:39
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.

2 participants