gildas-lormeau/SingleFile · error · Error
Default settings cannot be renamed
Error message
Default settings cannot be renamed
What it means
Thrown by renameProfile(oldProfileName, profileName) in src/core/bg/config.js:604 when an attempt is made to rename the built-in default profile (DEFAULT_PROFILE_NAME, e.g. "Default settings"). The default profile is fixed by design; callers should disallow rename operations on it in the UI and only permit renaming user-created profiles.
Source
Thrown at src/core/bg/config.js:604
const previousProfile = await getProfile(profileName);
Object.keys(previousProfile).forEach(key => {
profile[key] = profile[key] === undefined ? previousProfile[key] : profile[key];
});
await setProfile(profileName, profile);
}
async function renameProfile(oldProfileName, profileName) {
const profileNames = await getProfileNames();
const allTabsData = await tabsData.get();
const rules = await getRules();
if (!profileNames.includes(oldProfileName)) {
throw new Error("Profile not found");
}
if (profileNames.includes(profileName)) {
throw new Error("Duplicate profile name");
}
if (oldProfileName == DEFAULT_PROFILE_NAME) {
throw new Error("Default settings cannot be renamed");
}
if (allTabsData.profileName == oldProfileName) {
allTabsData.profileName = profileName;
await tabsData.set(allTabsData);
}
rules.forEach(rule => {
if (rule.profile == oldProfileName) {
rule.profile = profileName;
}
if (rule.autoSaveProfile == oldProfileName) {
rule.autoSaveProfile = profileName;
}
});
const profile = await getProfile(oldProfileName);
await configStorage.remove([PROFILE_NAME_PREFIX + oldProfileName]);
await configStorage.set({ [PROFILE_NAME_PREFIX + profileName]: profile, rules });
}
View on GitHub (pinned to 517fb7c5cf)
Solutions
- Skip the default profile in rename loops (check against the default profile name before renaming)
- Only allow rename actions on user-created profiles in UI code
- Catch the error and ignore it for the default profile
- Create a copy under a new name instead of renaming the default
Example fix
// before
for (const name of names) await config.renameProfile(name, name + '-old');
// after
for (const name of names) {
if (name === 'default') continue; // skip default profile
await config.renameProfile(name, name + '-old');
} Defensive patterns
Strategy: validation
Validate before calling
// default profile name per config.DEFAULT_PROFILE_NAME (e.g. 'default') if (oldProfileName === 'default') throw new Skip();
Type guard
const isDefaultProfile = (n) => n === config.DEFAULT_PROFILE_NAME;
Try / catch
try { await renameProfile(name, newName); } catch (e) { if (e.message === 'Default settings cannot be renamed') return; throw e; } Prevention
- Exclude the default profile from rename UI/actions
- Skip DEFAULT_PROFILE_NAME in bulk rename scripts
- Expose rename only for user-created profiles
- Create a new profile rather than renaming the default
When it happens
Trigger: renameProfile(DEFAULT_PROFILE_NAME, newName) called with the default profile name as the source — from UI misuse or scripts iterating all profiles and renaming each.
Common situations: Bulk rename scripts that don't skip the default profile; automation treating default like a normal profile; UI allowing rename on the default row by mistake.
Related errors
- SingleFile is disabled for this URL
- Duplicate profile name
- Profile not found
- Default settings cannot be deleted
- auth_not_supported
AI-assisted analysis of gildas-lormeau/SingleFile@517fb7c5cf (2026-09-01).
Data as JSON: /api/errors/12fd3c106fb7fdf9.
Report an issue: GitHub.