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

refactor(MessageHandler -> useServerStream): TS Conversion and Custom Hook instead of RFC #818

Merged
merged 4 commits into from
Aug 18, 2023

Conversation

danny-avila
Copy link
Owner

@danny-avila danny-avila commented Aug 18, 2023

Summary

refactor(MessageHandler -> useServerStream): convert all relating files to TS and correct typings based on this change: properly refactor MessageHandler to a custom hook (it was being used as a React Functional Component or RFC before), where it's passed a submission object to instantiate the stream. This is the bare minimum groundwork for potentially having multiple streams running, which would be a big project to modularize a lot of the global state into maps/multiple streams, particular useful for having multiple views or AI conversation in view.

Also fixed an issue with the abortMiddleware, to allow it to behave as expected even when aborted too "early" for the server (before the convoId is generated), In this case, the userId will be used as the abortKey. This should help with more reliability to the stop/continue e2e test.

Change Type

  • Refactor/TS conversion

Testing

Manual tests confirm no breaking changes, PR will determine how automated tests do.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.

fix(PluginAuthForm): handle case when pluginKey is null or undefined
fix(PluginStoreDialog): handle case when getAvailablePluginFromKey is null or undefined
fix(AuthContext): make authConfig optional in AuthContextProvider
feat(hooks): add useServerStream hook
fix(conversation): setSubmission to null instead of empty object
fix(preset): specify type for presets atom
fix(search): specify type for isSearchEnabled atom
fix(submission): specify type for submission atom
…es to TS and correct typings based on this change: properly refactor MessageHandler to a custom hook, where it's passed a submission object to instantiate the stream. This is the bare minimum groundwork for potentially having multiple streams running, which would be a big project to modularize a lot of the global state into maps/multiple streams, particular useful for having multiple views in place
…ersationId is undefined. In this case, the userId will be used as the abortKey
@danny-avila danny-avila merged commit 3c7f67f into main Aug 18, 2023
4 checks passed
@danny-avila danny-avila deleted the refactor-stream branch August 18, 2023 16:49
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.

1 participant