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

RustBackupManager.getServerBackupInfo() returns deleted backup info after RustBackupManager.deleteKeyBackupVersion() call #4534

Open
florianduros opened this issue Nov 18, 2024 · 0 comments
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@florianduros
Copy link
Contributor

RustBackupManager.deleteKeyBackupVersion deletes a key backup on the server:

public async deleteKeyBackupVersion(version: string): Promise<void> {
logger.debug(`deleteKeyBackupVersion v:${version}`);
const path = encodeUri("/room_keys/version/$version", { $version: version });
await this.http.authedRequest<void>(Method.Delete, path, undefined, undefined, {
prefix: ClientPrefix.V3,
});
}

If we delete the active backup, the properties RustBackupManager.serverBackupInfo & RustBackupManager.activeBackupVersion are out of sync.

When we call RustBackupManager.getServerBackupInfo, we get the key backup info of the deleted backup.

public async getServerBackupInfo(): Promise<KeyBackupInfo | null | undefined> {
// Do a validity check if we haven't already done one. The check is likely to fail if we don't yet have the
// backup keys -- but as a side-effect, it will populate `serverBackupInfo`.
await this.checkKeyBackupAndEnable(false);
return this.serverBackupInfo;
}

@florianduros florianduros added the O-Uncommon Most users are unlikely to come across this or unexpected workflow label Nov 18, 2024
@dosubot dosubot bot added A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Defect labels Nov 18, 2024
@florianduros florianduros changed the title RustBackupManager.getServerBackupInfo() return wrong backup info after RustBackupManager.deleteKeyBackupVersion() call RustBackupManager.getServerBackupInfo() return deleted backup info after RustBackupManager.deleteKeyBackupVersion() call Nov 18, 2024
@florianduros florianduros added the S-Major Severely degrades major functionality or product features, with no satisfactory workaround label Nov 18, 2024
@richvdh richvdh changed the title RustBackupManager.getServerBackupInfo() return deleted backup info after RustBackupManager.deleteKeyBackupVersion() call RustBackupManager.getServerBackupInfo() returns deleted backup info after RustBackupManager.deleteKeyBackupVersion() call Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

1 participant