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(spells): store last trigger by trigger key in KV [NET-511] #1728

Merged
merged 3 commits into from
Jul 31, 2023

Conversation

justprosh
Copy link
Member

@justprosh justprosh commented Jul 28, 2023

Description

Store only the last trigger event from nox (connection pool and timer trigger events) in spell KV by trigger key.

Motivation

Previously, trigger events were stored in the Spell Mailbox, but it can be used by other spells and clients to pass data to the spell, and it became hard to distinguish trigger events from other events. We decided to store only the last trigger separately, so spell developers can easily find the event that triggered spell execution by adding trigger arg to spell signature:

import TriggerEvent from "@fluencelabs/spell/trigger.aqua"

func spell_main(trigger: TriggerEvent, init_arg1: string, ...):
    ...

Related Issue(s)

[Cite any related issues or feature requests here, using GitHub issue links.]

Proposed Changes

  • store nox trigger events in spell KV by trigger key

Screenshots (if applicable)

[Add any relevant screenshots or animated GIFs to showcase the changes.]

Additional Notes

[Provide any additional information or context that may be helpful for the reviewer.]

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 Jul 28, 2023

NET-511 Pass trigger event as an arg to spell

Put it in spell's KV by trigger key

@justprosh justprosh added the e2e Run e2e workflow label Jul 28, 2023
@justprosh justprosh merged commit 7272040 into master Jul 31, 2023
16 checks passed
@justprosh justprosh deleted the trigger-arg branch July 31, 2023 12:03
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

4 participants