Repository navigation
fix(pos): sync receipt settings on tenant switch - #1313
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@greptileai review this at apex |
[Medium impact] The changes affect tenant receipt settings and printing within the POS workflow. Not ready to merge: canceled prints can be recorded as successful, and a pending print can still read another tenant's settings after A → B → A. Findings
|
1c076b9 to
037618f
Compare
|
@greptileai review this at apex |
|
@greptileai review this at apex |
037618f to
d383308
Compare
|
@greptileai review this at apex |
Fixes #1297
Summary
hydratedTenantIdinuseReceiptSettingsSyncso switchingcurrentTenantwithin the 60-secondFOCUS_SYNC_THROTTLE_MSwindow immediately forces a re-sync ofGET /api/settings/business.hydrateReceiptSettingsagainst stale in-flight responses whencurrentTenant?.idchanges before the request resolves, and avoid throttling or suppressing a subsequent sync for the newly active tenant.PrintCancelledOnTenantChangeErrorwhencurrentTenantswitches mid-print inusePrinterStoreand ignore it in callers so canceled prints neither report success/post print history nor show error toasts.tests/receipt-settings-hydration.test.tscovering immediate sync on tenant switch within the throttle window, stale in-flight response rejection, and mid-print tenant switch cancellation.