Skip to content

Fix blank page on refresh in Major and Cyclic physical inventory draft#80

Open
pitsophinnias wants to merge 1 commit into
pre-mainfrom
fix/refresh-page-physical-inventory
Open

Fix blank page on refresh in Major and Cyclic physical inventory draft#80
pitsophinnias wants to merge 1 commit into
pre-mainfrom
fix/refresh-page-physical-inventory

Conversation

@pitsophinnias

Copy link
Copy Markdown
  • Major refresh: recover draft from cache using id from URL when program and facility are missing from stateParams. Avoids crashing call to getPhysicalInventory which requires programId and facilityId to load stock card summaries. Program and facility resolves recover downstream from draft.programId and getUserHomeFacility() as designed.

  • Cyclic refresh: retain empty draft stub with clarifying comment. Cyclic has no id in the URL and no server persistence, so the cache key (cyclic-{programId}-{facilityId}) cannot be reconstructed on refresh. Page renders in blank start state rather than throwing an error.

- Major refresh: recover draft from cache using id from URL when program
  and facility are missing from stateParams. Avoids crashing call to
  getPhysicalInventory which requires programId and facilityId to load
  stock card summaries. Program and facility resolves recover downstream
  from draft.programId and getUserHomeFacility() as designed.
- Cyclic refresh: retain empty draft stub with clarifying comment. Cyclic
  has no id in the URL and no server persistence, so the cache key
  (cyclic-{programId}-{facilityId}) cannot be reconstructed on refresh.
  Page renders in blank start state rather than throwing an error.
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