Skip to content

Conversation

@vaibhav-devere
Copy link
Contributor

@vaibhav-devere vaibhav-devere commented Apr 17, 2025

Remove unnecessary await from encodeFileToken calls (now synchronous) #11611

Context

In PR #11385 – commit 26c17f3, FileService.encodeFileToken() was updated to be a synchronous method. However, several places in the codebase were still calling it using await.

Changes

This PR cleans up those redundant await usages to:

  • Improve clarity
  • Avoid confusion (no longer awaiting a non-Promise)
  • Slightly reduce overhead in affected functions
  • Removed await from calls to this.fileService.encodeFileToken(...)

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR removes unnecessary await calls from encodeFileToken() method across multiple files, following its conversion to a synchronous method in PR #11385.

  • Removed redundant await from fileService.encodeFileToken() in person/activity/attachment query result getters
  • Cleaned up unnecessary async calls in user.resolver.ts for avatar URL token generation
  • Simplified token generation in workspace and workspace-invitation resolvers for logo URLs
  • Maintains identical functionality while reducing overhead and improving code clarity

6 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

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

Good catch @vaibhav-devere, ty!

@charlesBochet charlesBochet merged commit 6023bda into twentyhq:main Apr 17, 2025
33 checks passed
@github-actions
Copy link
Contributor

Thanks @vaibhav-devere for your contribution!
This marks your 6th PR on the repo. You're top 6% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

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.

3 participants