Devvit Secret shadows Devvit Setting even after being deleted.

Open
#171 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript

Research direction

Start by reproducing the issue with the two Devvit.addSettings definitions and the ctx.settings.get("Gemini-API-Key") call, changing the setting from an app-scoped secret to an installation-scoped setting. Trace how settings and secret storage are resolved; done means the installation value is returned after the secret is removed, or a documented CLI deletion path is provided.

Written by the indexing model from the issue text.

Description

app-settings

I encountered an issue with Devvit Setting / Secret Storage. When I was developing app I added a secret to my devvit app.

Devvit.addSettings([
    {
        name: "Gemini-API-Key",
        label: "Gemini API Key",
        type: "string",
        scope: "app",
        helpText: "Enter your Gemini API Key here",
        isSecret: true
    },
]);

Later I ended up changing my mind and made it per install app because I thought it would be better if ever user brought their own api instead of using mine.

Devvit.addSettings([
    {
        name: "Gemini-API-Key",
        label: "Gemini API Key",
        type: "string",
        scope: "installation",
        helpText: "Enter your Gemini API Key here",
    },
]);

But with this change when I grab the key using the

const apiKey = (await ctx.settings.get("Gemini-API-Key")) as string;

It still grabs the old secret that I set instead of the new value from app setting page. So even when I stopped using the secret, the secret still somehow exist in the Devvit system.

Devvit needs to automatically clear secrets if they are not being referred in the code and free up its namespace. Or at least provide a cmd in devvit cli to delete all secret storage for an app.

Dominant language
TypeScript
Stars
210
Forks
88
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reddit/devvit

All issues in reddit/devvit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.