Skip to content

Removed futures from controller (#33)#139

Merged
TheLydonKing merged 1 commit intomasterfrom
feature/33-decide-to-either-execute-code-concurrently-or-not
Sep 12, 2025
Merged

Removed futures from controller (#33)#139
TheLydonKing merged 1 commit intomasterfrom
feature/33-decide-to-either-execute-code-concurrently-or-not

Conversation

@TheLydonKing
Copy link
Collaborator

Release Notes:

  • Removed Futures from all return types of the token controller
  • Amended Tests and classes required for this

closes: #33

@TheLydonKing TheLydonKing self-assigned this Sep 10, 2025
@TheLydonKing TheLydonKing linked an issue Sep 10, 2025 that may be closed by this pull request
@github-actions
Copy link

Report: Report: api - scala:2.12.17

Metric (instruction) Coverage Threshold Status
Overall 66.86% 43.0%
Changed Files 65.7% 70.0%
File Path Coverage Threshold Status
PublicKey.scala 57.89% 0.0%
PublicKeySet.scala 57.89% 0.0%
TokenController.scala 81.31% 0.0%

Copy link
Collaborator

@dk1844 dk1844 left a comment

Choose a reason for hiding this comment

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

LGTM in terms of complying with the task of removing the future.

I am thinking if we ever need to introduce futures for specific reasons, if this poses a problem -- I assume we can block/await for those or create specific endpoints.

Having futures in IO/web appcode always seemed natural, but I am willing to give this a try and see where it leads us.

{"key": "ZYXWVUT9876"},
]""")
keys: List[PublicKey]
) extends AnyVal
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the point of removing AnyVal here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some reason, having the anyVal had the json be encoded as "BASE64ENCODEDSTRING" instead of {"key":"BASE64ENCODEDSTRING"} and creating an issue when a Future is not being used.

@TheLydonKing
Copy link
Collaborator Author

LGTM in terms of complying with the task of removing the future.

I am thinking if we ever need to introduce futures for specific reasons, if this poses a problem -- I assume we can block/await for those or create specific endpoints.

Having futures in IO/web appcode always seemed natural, but I am willing to give this a try and see where it leads us.

I agree with this but I think in our case it may be redundant because our service and authentication layer isn't using Future or IO so it ends up being synchronous anyway and just adds overhead.

If we want to reimplement futures, it would probably be a bigger task of rewriting our services and authentication modules to be asynchronous.

@TheLydonKing TheLydonKing merged commit 381cfa1 into master Sep 12, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide to either execute code concurrently or not

2 participants