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

feat(builtins): add resolve_alias_opt [NET-528] #1769

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Conversation

justprosh
Copy link
Member

@justprosh justprosh commented Aug 24, 2023

Description

Provide a non-throwing method to resolve alias.

Motivation

We often call Srv.resolve_alias to check whether or not a service exists, but this method throws an error in the absence of this alias, which pollutes nox logs:

2023-08-19T00:07:09.186925Z  WARN tokio ThreadId(08) aquamarine::particle_functions: Failed host call "srv" "resolve_alias" "worker-spell" (36us 167ns): "Error: Service with alias 'worker-spell' is not found on worker '12D3KooWMXaLQfKpH6PnfcAjmnPsaz5gLMjZ6knmVN28THaYpd8v'\nNoSuchAlias(\"worker-spell\", PeerId(\"12D3KooWMXaLQfKpH6PnfcAjmnPsaz5gLMjZ6knmVN28THaYpd8v\"))" particle_id="spell_5c84196c-e598-460f-8965-128354d9f140_0"

Proposed Changes

Implement Srv.resolve_alias_opt:

service Srv:
  resolve_alias_opt(alias: string) -> ?string

Checklist

  • The code follows the project's coding conventions and style guidelines.
  • All tests related to the changes have passed successfully.
  • Documentation has been updated to reflect the changes (if applicable).
  • All new and existing unit tests have passed.
  • I have self-reviewed my code and ensured its quality.
  • I have added/updated necessary comments to aid understanding.

Reviewer Checklist

  • Code has been reviewed for quality and adherence to guidelines.
  • Tests have been reviewed and are sufficient to validate the changes.
  • Documentation has been reviewed and is up to date.
  • Any questions or concerns have been addressed.

@linear
Copy link

linear bot commented Aug 24, 2023

@justprosh justprosh merged commit b352cad into master Aug 31, 2023
22 checks passed
@justprosh justprosh deleted the resolve-alias-opt branch August 31, 2023 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants