laurent22/joplin · warning · Error
This profile is already active
Error message
This profile is already active
What it means
Thrown by `switchProfile` in the mobile profile service when the requested `profileId` is already the `currentProfileId` in the loaded config. Switching to the active profile is a no-op and would pointlessly `restartApp`, so it is rejected up front.
Source
Thrown at packages/app-mobile/services/profiles/index.ts:58
if (!isSubProfile) return `joplin${suffix}.sqlite`;
return `joplin-${profile.id}${suffix}.sqlite`;
};
export const loadProfileConfig = async () => {
return libLoadProfileConfig(getProfilesConfigPath());
};
export const saveProfileConfig = async (profileConfig: ProfileConfig) => {
await libSaveProfileConfig(getProfilesConfigPath(), profileConfig);
dispatch_({
type: 'PROFILE_CONFIG_SET',
value: profileConfig,
});
};
export const switchProfile = async (profileId: string) => {
const config = await loadProfileConfig();
if (config.currentProfileId === profileId) throw new Error('This profile is already active');
config.currentProfileId = profileId;
await saveProfileConfig(config);
shim.restartApp();
};
View on GitHub (pinned to 2654b33620)
Solutions
- In the UI, disable or mark the active profile row as non-selectable.
- Pre-check: `if (profileId === currentProfileId) return;` before calling `switchProfile`.
- Idempotency: catch the error and treat it as success when the goal state is already met.
Example fix
// before
await switchProfile(profileId);
// after
const config = await loadProfileConfig();
if (config.currentProfileId !== profileId) {
await switchProfile(profileId);
} Defensive patterns
Strategy: validation
Validate before calling
const config = await loadProfileConfig();
if (config.currentProfileId === profileId) {
logger.info('Profile already active; skipping switch');
return;
}
await switchProfile(profileId); Type guard
null
Try / catch
try {
await switchProfile(profileId);
} catch (error) {
if (/already active/i.test(error.message)) return;
throw error;
} Prevention
- Disable the active profile row in the switcher UI.
- Pre-check currentProfileId before calling switchProfile.
- Avoid issuing a second switch before restartApp completes.
When it happens
Trigger: Calling `switchProfile(profileId)` where `profileId === (await loadProfileConfig()).currentProfileId`. Commonly hit from the profile switcher UI when the user taps the currently-selected profile.
Common situations: UI bug that does not mark/highlight the active profile row; double-tap on the active row; programmatic switch issued right after a previous switch but before `restartApp` takes effect.
Related errors
- The active profile cannot be deleted. Switch to a different
- No note with id ${id}
- No supported provider found!
- Item not found: ${itemId}
- Unsupported item type for links: ${item.type_}
AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12).
Data as JSON: /api/errors/4303879cb8290a4b.
Report an issue: GitHub.