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

[Bug] Server stats at a date when the organization doesn't exist yet #9427

Closed
vxgmichel opened this issue Jan 24, 2025 · 0 comments · Fixed by #9463
Closed

[Bug] Server stats at a date when the organization doesn't exist yet #9427

vxgmichel opened this issue Jan 24, 2025 · 0 comments · Fixed by #9463
Assignees
Labels
A-Server Area: Parsec Server
Milestone

Comments

@vxgmichel
Copy link
Contributor

It's unclear from the code base whether those stats should be absent from the response or should be all set to zero.

The memory implementation sets all the stats to zero without considering the organization created_on date:

The postgresql implementation returns an error if the organization did not exist at that time:

# `None` if the orga doesn't exist, `False` if the orga exists but is too recent
case False | None:
return OrganizationStatsBadOutcome.ORGANIZATION_NOT_FOUND

However this exception is not properly handled in organization_server_stats which causes a TypeError:

org_stats = await _get_organization_stats(conn, org_id, at=at)

There is a test_server_stats_at test:

async def test_server_stats_at(

But it doesn't test this case since the minimal organization is created at linux epoch.

@FirelightFlagboy FirelightFlagboy changed the title Server stats at a date when the organization doesn't exist yet [Bug] Server stats at a date when the organization doesn't exist yet Jan 29, 2025
@FirelightFlagboy FirelightFlagboy added the A-Server Area: Parsec Server label Jan 29, 2025
@mmmarcos mmmarcos added this to the v3.3 milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Server Area: Parsec Server
Projects
None yet
3 participants