Skip to content

1.7.2

βš™οΈ Patch 1.7.2 β€” Cron export fixes, Kaufland status, Shopify deferral, and dark mode

πŸš€ Summary

  • Fixed post-cron export for Kaufland, FBA, FBM, and Shopify so articles marked update_needed are actually cleared after a successful marketplace export.
  • Kaufland no longer reports β€œsuccessful” API calls while leaving articles stuck in update_needed; detached SQLAlchemy sessions after long async calls are handled safely.
  • Shopify export no longer blocks for up to ~10 minutes when Plenty defers the export β€” deferred items are queued and retried automatically every 3 minutes.
  • Dark mode readability fixes across credentials pages, cron schedule/status panels, MultiRepricer tables/filters, and the background-jobs widget.
  • n8n heap limit raised to reduce OOM crashes on heavy workflows.

✨ Improvements

  • Cron / base sync export (service_multi-repricer):
  • Kaufland, FBM, and FBA exports run on a fresh DB session after recalculation so ORM objects expired during recalc do not break the export phase.
  • UVP background export uses the same fresh-session pattern for Kaufland and FBM.
  • Shopify deferred export:
  • export_to_shopify returns a structured ShopifyExportResult (success / deferred / retry_after_seconds) instead of a bare boolean.
  • Background exports (run_shopify_export, cron) use block_on_deferred=False β€” Plenty’s β€œwait N minutes” response is stored on the article (error_message: SHOPIFY_EXPORT_DEFERRED:<iso-timestamp>) and the task finishes immediately.
  • New cron job shopify_deferred_export_retry (every 3 minutes) retries due deferred SKUs with a single quick attempt per run.
  • Bulk export skips deferred items until their scheduled retry time to avoid hammering Plenty early.
  • Direct /plenty/export-to-shopify API still blocks on deferral when a synchronous result is required.
  • FBA export:
  • After Sellerlogic batch reprice, FBADetails are re-fetched by article_id before setting ACTIVE (avoids detached-instance errors).
  • Kaufland export:
  • Eager-loads unit/price/status fields before async Plenty/Kaufland calls; re-fetches details before DB update.
  • Uses storefront or shop.storefront or "de" when cron passes storefront=None.
  • PAUSED check uses ArticleStatus.PAUSED (lowercase) instead of "PAUSED".
  • Dark mode (frontend):
  • Shared panelStyles.js helpers for credential cards, cron builders, status panels, table headers, and filter surfaces.
  • Reusable CronBuilderBox and CronStatusPanel components; global .cron_builder overrides in AppThemeProvider.
  • All *Credentials.jsx pages use theme-aware gradients instead of hardcoded light backgrounds.
  • Theme grey palette remapped in dark mode so grey.50 / grey.100 (table headers, filter panels, expanded rows) render as dark surfaces app-wide.
  • MUI overrides for table head cells, outlined inputs (search/filter fields), and labels in dark mode.
  • MultiRepricer TaskStatusWidget uses background.paper + readable text instead of a fixed white panel.
  • Infrastructure:
  • n8n + runners: NODE_OPTIONS=--max-old-space-size=${N8N_NODE_MAX_OLD_SPACE_SIZE:-8192} (was 4096).
  • n8n / runners mem_limit: 10g; Selenium shm_size: 4gb, mem_limit: 6g.

πŸ› Bug Fixes

  • Kaufland update_needed stuck after successful export: on success, status was only set to active when the article was not update_needed β€” cron exports only process update_needed items, so they never cleared. Now always sets active on successful export.
  • Kaufland / FBA background export crash: Instance <KauflandDetails> is not bound to a Session (and equivalent FBA errors) after long await chains β€” fixed by re-querying details after async work and using a dedicated export session post-recalc.
  • FBA repricer_article not defined: missing CRUD import in fba_articles.py broke post-export status updates.
  • Single-SKU sync recalculated all articles: _sync_articles_internal now passes sku=sku into per-channel recalc/export instead of sku=None.
  • FBA / FBM recalc on OOS articles: articles with status oos are skipped during recalculation.
  • Shopify repricer cron: cron_job_wrapper incorrectly called export_updates(db); now awaits run_shopify_export(sku_inner=None) directly.
  • FBM bulk export crash: process_export_updates failed with 'NoneType' object has no attribute 'get' when international_pricing.DE, max_bound, or min_bound was null in JSON, or Sellerlogic returned a None per-SKU result β€” fixed with safe nested pricing accessors and guarded batch-result handling.
  • Dark mode UI: credentials, cron β€œStatus Information” panels, and cron schedule pickers stayed bright with low-contrast text; table header rows and search/filter bars in MultiRepricer (e.g. Base Articles) used light grey.50 surfaces in dark mode.

πŸ“ Files changed

Backend (service_multi-repricer)

  • app/api/v1/endpoints/kaufland_articles.py β€” export status logic, detached-session safety, storefront fallback.
  • app/api/v1/endpoints/fba_articles.py β€” export re-fetch, repricer_article import, OOS recalc skip.
  • app/api/v1/endpoints/fbm_articles.py β€” OOS recalc skip, safe international_pricing access in export.
  • app/api/v1/endpoints/repricer_articles.py β€” fresh export_db for cron/UVP export, single-SKU sync scope.
  • app/api/v1/endpoints/shopify_articles.py β€” deferred export queue, retry runner, cron wrapper fix.
  • app/api/v1/endpoints/plenty.py β€” ShopifyExportResult handling.
  • app/services/plenty/plenty_manager.py β€” ShopifyExportResult, non-blocking deferral option.
  • app/main.py β€” register shopify_deferred_export_retry cron on startup.

Frontend

  • src/theme/index.js β€” dark grey palette, table/input MUI overrides.
  • src/theme/panelStyles.js β€” credential, cron, table, and filter panel helpers.
  • src/components/AppThemeProvider.jsx β€” global dark-mode .cron_builder styles.
  • src/components/CronBuilderBox.jsx, src/components/CronStatusPanel.jsx β€” new shared cron UI.
  • src/pages/MultiRepricer/TaskStatusWidget.jsx β€” dark-mode panel styling.
  • src/pages/MultiRepricer/Tabs/BaseArticles/BaseArticles.jsx β€” filter panel + table head dark mode.
  • src/pages/**/Credentials/*.jsx β€” theme-aware credential layouts (all services).
  • Cron tabs updated: Statistics (Shopping Table, Profit), Tickets, Plenty Populate Articles, JTL Bundles/Inbounds, Rituals Outlet.

Infrastructure

  • docker-compose.yml, docker-compose-portainer.yml β€” n8n memory limits.
  • docs/docs/patchnotes/1.7/1.7.2.md β€” this patchnotes entry.

πŸ”§ Database & SQL

  • No schema migration required.
  • Deferred Shopify exports are tracked via shopify_details.error_message prefix SHOPIFY_EXPORT_DEFERRED: + ISO retry timestamp; status stays update_needed until retry succeeds.

Usage notes

  • After deploy, run the base repricer cron (or channel export endpoints) once to clear any backlog of stuck update_needed articles.
  • Shopify logs for deferred exports will show export deferred … (not blocking, retry in …s) instead of a multi-minute sleep; check shopify_deferred_export_retry cron logs for completion.
  • Articles still update_needed after export may be skipped by design (e.g. FBM/FBA international_pricing.DE.ignore not explicitly false, Kaufland missing id_unit/prices, or paused status) β€” inspect error_message on the channel detail row.
  • Optional env override for n8n heap: N8N_NODE_MAX_OLD_SPACE_SIZE=8192 (or higher) in compose / Portainer stack.
  • Dark mode preference is per-user (Settings β†’ Appearance); no extra migration or cache clear required.