@faable/faable 3.1.0 → 3.1.1

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.
@@ -99,7 +99,9 @@ const secrets_set = {
99
99
  const existing = await ctx.api.getAppSecrets(app_id);
100
100
  const merged = merge_app_secrets(existing, parsed);
101
101
  await ctx.api.createSecretsBatch(app.id, app.team, merged);
102
- const current = new Set(existing.filter(s => s.related_model === 'app').map(s => s.name));
102
+ const current = new Map(existing
103
+ .filter(s => s.related_model === 'app')
104
+ .map(s => [s.name, s.value]));
103
105
  const updated = parsed.filter(({ name }) => current.has(name)).length;
104
106
  if (parsed.length <= MAX_DETAILED) {
105
107
  for (const { name } of parsed) {
@@ -112,7 +114,14 @@ const secrets_set = {
112
114
  log.info(`🔑 ${parsed.length - updated} added, ${updated} updated`);
113
115
  }
114
116
  log.info(`✅ ${parsed.length} secret(s) saved to ${app_id}.`);
115
- log.info(`â„šī¸ The app is restarting to apply the changes.`);
117
+ // Only claim the restart when something actually changed. Setting a name
118
+ // to the value it already has is a no-op end to end — the API compares
119
+ // before writing and never emits the event, so the pod keeps running —
120
+ // and this line used to promise a restart that was not coming.
121
+ const changed = parsed.some(({ name, value }) => current.get(name) !== value);
122
+ log.info(changed
123
+ ? `â„šī¸ The app is restarting to apply the changes.`
124
+ : `â„šī¸ Already up to date — the app was not restarted.`);
116
125
  }
117
126
  };
118
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/faable",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Marc Pomar <marc@faable.com>",