Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Fall back to leaf cluster id when restoring leaf cluster terminal document#920

Merged
gzdunek merged 3 commits intomasterfrom
gzdunek/restoring-leaf-terminal-documents
Jun 27, 2022
Merged

Fall back to leaf cluster id when restoring leaf cluster terminal document#920
gzdunek merged 3 commits intomasterfrom
gzdunek/restoring-leaf-terminal-documents

Conversation

@gzdunek
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek commented Jun 24, 2022

@gzdunek gzdunek requested a review from ravicious June 24, 2022 15:43
Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I'm glad we managed to fix this before the GA release!

Comment on lines +66 to +70
When restoring the documents, we do not always have the leaf clusters already fetched.
In that case we can fall back to `clusterId` from a leaf cluster URI
(for a leaf cluster `clusterId` === `actualName`)
*/
const parsed = routing.parseClusterUri(clusterUri);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comment, thanks.

const parsed = routing.parseClusterUri(clusterUri);

if (!parsed?.params?.leafClusterId) {
throw new Error('Incorrect cluster URI');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message could provide more information though. :D Maybe something that at this point a leaf cluster URI was expected but the URI doesn't seem to include a leaf cluster ID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks

@gzdunek gzdunek merged commit 74d92be into master Jun 27, 2022
@gzdunek gzdunek deleted the gzdunek/restoring-leaf-terminal-documents branch June 27, 2022 08:59
gzdunek added a commit that referenced this pull request Jun 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants