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

[Enhancement]: For testers, when no testing server is available, return the production server #150

Closed
1 task done
InternalLoss opened this issue Jan 28, 2025 · 4 comments
Labels
approved The topic is approved by a developer enhancement An update to an existing part of the codebase

Comments

@InternalLoss
Copy link

Checked Existing

  • I have checked the repository for duplicate issues.

What enhancement would you like to see?

Currently, if a server set to testing environment is not available, users set to test servers will receive an error, causing us to need to duplicate servers across prod and test. However, it would be preferable if we didn't have to do this - if a test server is set this should override the production server for testing users, otherwise send them to the same production servers.

Any other details to share? (OPTIONAL)

No response

@InternalLoss InternalLoss added awaiting-approval Topic has not been approved or denied enhancement An update to an existing part of the codebase labels Jan 28, 2025
@binaryoverload
Copy link
Member

binaryoverload commented Jan 28, 2025

Currently, the servers are retrieved by access level here:

account/src/database.js

Lines 204 to 209 in 8c259c9

function getServerByTitleId(titleId, accessMode) {
return Server.findOne({
title_ids: titleId,
access_mode: accessMode,
});
}

We could change this to get all servers regardless of access level, and then use fallback like so depending on the user's access level:

flowchart TD
    Development--When no dev env-->Tester
    Tester--When no tester env-->Prod
    UserDev{{"User (Developer)"}} --> Development
    UserTest{{"User (Tester)"}} --> Tester
    User{{"User (Normal)"}} --> Prod
Loading

@AToska21
Copy link

Currently, the servers are retrieved by access level here:

account/src/database.js

Lines 204 to 209 in 8c259c9

function getServerByTitleId(titleId, accessMode) {
return Server.findOne({
title_ids: titleId,
access_mode: accessMode,
});
}
We could change this to get all servers regardless of access level, and then use fallback like so depending on the user's access level:

could probably be done by if no server is found by the requested access level fall back to the lower access level (e.g. dev --> test --> prod)

sidenote: how'd you do that flowchart thing?

@binaryoverload
Copy link
Member

sidenote: how'd you do that flowchart thing?

Using a Mermaid diagram - docs here: https://mermaid.js.org/intro/

@binaryoverload binaryoverload added approved The topic is approved by a developer and removed awaiting-approval Topic has not been approved or denied labels Jan 30, 2025
@AToska21
Copy link

Made a PR for this, #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved The topic is approved by a developer enhancement An update to an existing part of the codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants