squarefi-bff-api-module 1.36.15 → 1.36.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,8 +13,11 @@ export const useSupabaseSubscription = ({ config, callback, enabled = true, key
13
13
  supabaseClient.removeChannel(subscriptionRef.current);
14
14
  subscriptionRef.current = null;
15
15
  }
16
+ // The channel name IS the broadcast topic — it must match what the DB trigger sends
17
+ // (`wallet-transactions-<walletId>`). `key` only re-triggers the effect (see deps), it must
18
+ // never override the topic, otherwise the client subscribes to the wrong channel.
16
19
  const subscription = supabaseClient
17
- .channel(key || config.channelName, { config: { private: true } })
20
+ .channel(config.channelName, { config: { private: true } })
18
21
  .on('broadcast', { event: config.event }, (payload) => callbackRef.current(payload))
19
22
  .subscribe();
20
23
  subscriptionRef.current = subscription;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.15",
3
+ "version": "1.36.16",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",