Skip to content

fix: get own user without listing workspace users - #302

Merged
lucassabreu merged 1 commit into
lucassabreu:mainfrom
reva:fix/get-user-without-workspace-users
Aug 21, 2026
Merged

fix: get own user without listing workspace users#302
lucassabreu merged 1 commit into
lucassabreu:mainfrom
reva:fix/get-user-without-workspace-users

Conversation

@reva

@reva reva commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Suggestion to fix #301

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.35%. Comparing base (45bd1e7) to head (a951d83).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #302      +/-   ##
==========================================
+ Coverage   31.46%   32.35%   +0.88%     
==========================================
  Files         141      141              
  Lines        9016     9020       +4     
==========================================
+ Hits         2837     2918      +81     
+ Misses       6074     5988      -86     
- Partials      105      114       +9     
Flag Coverage Δ
unittests 32.35% <100.00%> (+0.88%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@reva
reva marked this pull request as draft August 20, 2026 15:55
@reva
reva force-pushed the fix/get-user-without-workspace-users branch from 672d651 to 4c0c845 Compare August 20, 2026 15:56
Comment thread api/client.go Outdated
Comment on lines +805 to +808
// listing workspace users requires admin rights
if me, err := c.GetMe(); err == nil && me.ID == p.UserID {
return me, nil
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

i think is better to revert this change, instead change here to use the GetMe method

i think i forgot about the GetMe when i did the GetUsersHydratedTimeEntries function

the revert is so that if someone is using the GetUser it does have to call the GetMe before going for the user they want

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.

Thanks, that makes more sense! I also removed the attempt at caching the call, I don't think it's worth it.

@reva
reva force-pushed the fix/get-user-without-workspace-users branch 2 times, most recently from e7a5a8a to 16438c5 Compare August 21, 2026 06:33
@reva
reva force-pushed the fix/get-user-without-workspace-users branch from 16438c5 to a951d83 Compare August 21, 2026 06:35
@reva
reva marked this pull request as ready for review August 21, 2026 06:39
@lucassabreu
lucassabreu merged commit f47472d into lucassabreu:main Aug 21, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reports for own user without without listing workspace users

2 participants