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: add preCreateIdentityCallback & preEnableIdentityCallback #177

Merged
merged 10 commits into from
Dec 16, 2023

Conversation

kele-leanes
Copy link
Contributor

@kele-leanes kele-leanes commented Dec 13, 2023

Description:
This pull request introduces the implementation of preCreateIdentityCallback and preEnableIdentityCallback functionalities, addressing the specific requirements outlined in this ticket. The implementation leverages event handling, as it is the most suitable approach for executing JavaScript code from the native side.

To achieve this, the code ensures proper execution of the specified callbacks, and subsequently, an unsubscription process is initiated. This unsubscription is crucial to prevent inadvertent re-execution of the callback every time the Client is created.

Thorough testing has been conducted with this Android package version and this iOS package

iOS Android

@kele-leanes kele-leanes self-assigned this Dec 13, 2023
@kele-leanes kele-leanes requested a review from a team as a code owner December 13, 2023 19:33
Copy link
Contributor

@cameronvoell cameronvoell left a comment

Choose a reason for hiding this comment

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

I was able to see the callbacks running locally by testing against your linked android and ios PRs. Everything worked well. This PR looks good to me.

I think we should wait for the Android and iOS PRs to merged before we merge this one so that we can update the native modules in this PR for xmtp-react-native to run properly.

As soon as those PRs are approved and merged, I think we can merge this one as well. Nice work @kele-leanes !

@nplasterer
Copy link
Contributor

I'm getting an error when I try to run the app after pulling in main and bumping the versions.

 ERROR  Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app

It might be related to @alexrisch hook changes?

@nplasterer
Copy link
Contributor

I was able to revert the hooks PR and validate the example was working prior to that. I'm going to merge this to unblock integrators and we can fix the example app in a follow up as I confirmed the SDK works as intended only the example is broken.

@nplasterer nplasterer merged commit c51dbba into main Dec 16, 2023
4 of 5 checks passed
@nplasterer nplasterer deleted the feat/pre-callback-events branch December 16, 2023 15:45
Copy link
Contributor

🎉 This PR is included in version 1.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@alexrisch
Copy link
Contributor

I'm getting an error when I try to run the app after pulling in main and bumping the versions.

 ERROR  Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app

It might be related to @alexrisch hook changes?

Created a PR which should hopefully fix these weird resolutions and the hook PR: #185

TLDR: Resolutions are a pain, and multiple react versions were being used

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.

4 participants