Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devvit Secret shadows Devvit Setting even after being deleted. #171

Open
isFakeAccount opened this issue Feb 24, 2025 · 0 comments
Open

Comments

@isFakeAccount
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant