fix(storefront): Fix loyalty points not showing at checkout when store has discount preset - #804
Closed
vitorrgg wants to merge 2 commits into
Closed
fix(storefront): Fix loyalty points not showing at checkout when store has discount preset#804vitorrgg wants to merge 2 commits into
vitorrgg wants to merge 2 commits into
Conversation
Member
|
Branch tá todo cagado viu |
Porta o app Bling ERP (app_id 102418) do repositório app-bling-erp-v2 para
o monorepo, usando a API v3 do Bling: exportação de pedidos e produtos,
importação de estoque, pedidos e categorias, e renovação automática dos
tokens OAuth.
Funções: `blingerp-onStoreEvent` (eventos da loja), `blingerp-callback`
(callbacks de estoque/pedidos do Bling), `blingerp-authCallback` (fluxo de
autorização OAuth) e `blingerp-cronRefreshToken`.
A fila do app v1 em Firestore (`queue/{storeId}/events` + `running_events`)
foi substituída pelo PubSub de eventos do monorepo, e o `appSdk` multi-loja
pelo `@cloudcommerce/api`. Tokens ficam em `blingTokens/{storeId}` e o cache
de situações de venda em `blingStatuses/{storeId}`.
Correções sobre o comportamento do app v1:
- atualização de produto com variações falhava com 400 no Bling, porque as
variações eram enviadas sem ID (a listagem `/produtos?codigo=` devolve o
produto resumido);
- preço por variação era perdido na exportação (o Bling aplica o preço do
produto pai), agora corrigido com PUT por variação divergente;
- callback de estoque de variação sem SKU no Bling era descartado, agora usa
o ID do Bling como referência;
- configuração "Importar produto" não tinha efeito, pois o callback forçava
`canCreateNew: false`;
- status "Devolvido" era enviado como fulfillment inválido;
- limite diário da API gravava a flag invertida, liberando novas chamadas;
- grades de variação importadas viram `size`/`age_group`/`gender` como no
sentido inverso, em vez de slug do rótulo;
- sem situação correspondente no Bling, o pedido não falha mais: registra
aviso e segue exportado.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…e has discount preset When a store has discount_option or installments_option configured in modules settings, modulesInfo[list_payments] was already non-empty from the preset, causing fetchInfo to skip the API call entirely. As a result, loyalty_points_programs returned by the loyalty app was never merged into storefront.info, so PointsApplier never received the programs and the toggle was not rendered. Fix: always fetch from the API, emitting preset data immediately as an initial value for fast rendering while the API call completes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vitorrgg
force-pushed
the
fix/storefront-loyalty-points-preset-skip
branch
from
August 7, 2026 19:33
f486478 to
009ffe5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
discount_optionorinstallments_optionconfigured in modules settings (e.g. PIX discount) hadmodulesInfo.list_paymentspre-populated from the preset on page loadfetchInfowas skipping the API call when any preset data existed, emitting only{ discount_option }without ever fetchingloyalty_points_programsfrom the loyalty appwaitStorefrontInfo('list_payments', 'loyalty_points_programs')inPointsApplierwould never resolve, so the loyalty points toggle was never rendered in checkoutRoot cause commit: a3ab982 — "Handle modules info watchers on checkout (vbeta app)"
Fix: always fetch from the API; emit preset/cached data immediately as an initial value for fast rendering while the API call completes.
Test plan
window.storefront?.info?.list_payments?.loyalty_points_programsis populated after checkout load🤖 Generated with Claude Code