Skip to content

Fix: configs being reset#3064

Merged
HarshMN2345 merged 2 commits into
appwrite:mainfrom
ItzNotABug:fix-settings-clobber
May 28, 2026
Merged

Fix: configs being reset#3064
HarshMN2345 merged 2 commits into
appwrite:mainfrom
ItzNotABug:fix-settings-clobber

Conversation

@ItzNotABug
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the case where the deployment retention and logging were not applied correctly.

Test Plan

Manual.

Related PRs and Issues

N/A.

Have you read the Contributing Guidelines on issues?

Yes.

fix: configs not being applied correctly.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile Summary

This PR fixes two related bugs where updating deployment retention or logging settings would incorrectly reset other config values: boolean fields (enabled, logging, providerSilentMode) were passed through || instead of ??, causing false values to be coerced to undefined; and deploymentRetention was absent from the updateLogging payload, silently resetting it on every logging toggle.

  • Replaces || undefined with ?? undefined for enabled, logging, and providerSilentMode in both updateDeploymentRetention.svelte and updateLogging.svelte for functions and sites.
  • Adds the missing deploymentRetention field to the updateLogging API calls for functions and sites so retention is preserved when toggling logging.
  • The identical || undefined pattern for boolean fields and the absent deploymentRetention field still exist in all other settings update components (e.g. updateTimeout, updateName, updateScopes, updateRuntime, updatePermissions, updateSchedule, updateResourceLimits, updateBuildCommand, updateEvents, updateRepository, disconnectRepo for both functions and sites).

Confidence Score: 3/5

The fix is correct within the four touched files, but the same bugs remain active in more than a dozen other settings components — merging as-is leaves most settings-update paths still capable of resetting enabled, logging, or deploymentRetention.

The updateLogging and updateDeploymentRetention components are fixed correctly. However, every other partial-update settings file for both functions and sites still uses || undefined for boolean fields and omits deploymentRetention from the payload, meaning saving name, timeout, scopes, schedule, runtime, permissions, resource limits, build command, events, or repository settings can silently reset those values for any resource where they are false or 0.

All sibling settings update files not touched by this PR: updateTimeout.svelte, updateName.svelte, updateScopes.svelte, updateSchedule.svelte, updateRuntime.svelte, updatePermissions.svelte, updateResourceLimits.svelte, updateBuildCommand.svelte, updateEvents.svelte, updateRepository.svelte, and disconnectRepo.svelte for both functions and sites.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateDeploymentRetention.svelte Fixes `
src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateLogging.svelte Adds missing deploymentRetention to the API payload and fixes `
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateDeploymentRetention.svelte Mirrors the function-side fix: `
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateLogging.svelte Adds missing deploymentRetention and fixes `

Reviews (1): Last reviewed commit: "bump: lock." | Re-trigger Greptile

Comment thread bun.lock
@HarshMN2345 HarshMN2345 merged commit a9baf8b into appwrite:main May 28, 2026
3 checks passed
@ItzNotABug ItzNotABug deleted the fix-settings-clobber branch May 28, 2026 06:41
yonas pushed a commit to yonasBSD/appwrite-console that referenced this pull request May 29, 2026
…ngs updates

Extends the fix from appwrite#3064 to the remaining 20 settings update components
for both functions and sites. Two bugs were present in every file not
touched by that PR:

1. `enabled`, `logging`, and `providerSilentMode` were passed through
   `|| undefined` instead of `?? undefined`, causing `false` values to
   be silently coerced to `undefined` and reset to their API defaults
   whenever any other setting was saved.

2. `deploymentRetention` was absent from every partial-update payload,
   so saving name, timeout, scopes, schedule, runtime, permissions,
   resource limits, build command, events, build triggers, or repository
   settings would silently reset the retention value.

Also fixes `providerSilentMode: silentMode || undefined` in sites/
updateRepository.svelte to `silentMode` (matching the functions version),
so disabling silent mode is correctly preserved on save.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants