Skip to content

1.6.7

βš™οΈ Patch 1.6.7 β€” FBA/FBM recalc, sync and live UI refresh

πŸš€ Summary

  • Fix FBA recalculation routing so margin-rule articles use full SP-API recalc instead of a no-op manual-override path.
  • Make FBA sync replace international_pricing from Sellerlogic and remove stale marketplaces no longer returned by the API.
  • Run single-SKU FBA/FBM recalc synchronously and auto-refresh the UI via WebSocket when background jobs finish.
  • Fix stuck background-job status dots and several FBA recalc/sync edge cases.

✨ Improvements

  • Backend (FBA):
  • use_min_max_rules=True (default) now runs full SP-API recalc; only use_min_max_rules=False keeps manual prices and refreshes profit only (aligned with FBM).
  • FBA sync overrides min/max target_price and hazmat from Sellerlogic per marketplace and drops countries absent from the API response (e.g. PL/SE removed when only DE/NL/ES are returned).
  • Per-country ignore flags are preserved when a marketplace still exists after sync.
  • Recalc/sync logging lists target, processed/updated, and skipped marketplaces for easier debugging.
  • JSONB international_pricing updates use flag_modified so profit/price changes persist reliably.
  • Backend (FBA / FBM recalc endpoints):
  • Single-SKU POST /recalculate/{sku} awaits completion and returns the result; all still runs in the background.
  • On finish, WebSocket sends task_status (inactive) plus item_update (recalculated) for single-SKU jobs.
  • Backend (workflows):
  • Base sync/UVP background jobs clear recalc and export flags in separate phases (export only active during export).
  • FBA recalc always sends task_status finish (including early exits such as missing credentials).
  • Frontend:
  • FBA/FBM tabs subscribe to WebSocket task finish and item_update events and reload articles/stats when recalc completes.
  • β€œRecalc all” no longer reloads immediately on API return; refresh happens when the job actually finishes.
  • Task status WebSocket keys normalized consistently with the backend (recalculate β†’ recalc).

πŸ› Bug Fixes

  • Fixed base-level recalc/export dots staying red after sync/UVP workflows completed.
  • Fixed FBA recalc 500 when international_pricing contained null country entries (e.g. PL/SE).
  • Fixed FBA recalc appearing to run but not updating pricing because autocalculate articles were on the manual-override code path.
  • Fixed FBA sync merging old marketplaces instead of replacing pricing from the latest Sellerlogic response.
  • Fixed Shopify single-SKU recalc leaving the task flag active when the article was not found after start notify.
  • Fixed frontend reloading stale data after per-SKU recalc because the API returned before the background job finished.

πŸ“ Files changed

  • backend/service_multi-repricer/app/api/v1/endpoints/fba_articles.py β€” recalc routing; sync replace/prune; null-safe pricing; sync helpers; sync single-SKU endpoint; WebSocket item updates.
  • backend/service_multi-repricer/app/api/v1/endpoints/fbm_articles.py β€” sync single-SKU recalc endpoint; WebSocket item updates.
  • backend/service_multi-repricer/app/api/v1/endpoints/repricer_articles.py β€” base sync/UVP task-status lifecycle (recalc/export phases).
  • backend/service_multi-repricer/app/api/v1/endpoints/shopify_articles.py β€” finish notify when SKU not found after recalc start.
  • backend/service_multi-repricer/app/notifications.py β€” shared task-name normalization and status keys.
  • frontend/src/services/ws/taskStatus.js β€” subscribeFinish, subscribeItemUpdate, normalized keys.
  • frontend/src/pages/MultiRepricer/Tabs/FBA/FBAArticles.jsx β€” WebSocket-driven refresh after recalc.
  • frontend/src/pages/MultiRepricer/Tabs/FBM/FBMArticles.jsx β€” WebSocket-driven refresh after recalc.