-
Notifications
You must be signed in to change notification settings - Fork 39
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(CLNP-3879): support mmkv storage and deprecate an async storage #185
base: main
Are you sure you want to change the base?
Conversation
아래와 같은 에러가 발생하면서 ios시뮬레이터에서 실행이 되지 않는데, 디버거 모드시 안된다는 내용같아서 릴리즈로 실행 했는데도? 안되고 있습니다. Error: Failed to create a new MMKV instance: React Native is not running on-device. MMKV can only be used when synchronous method invocations (JSI) are possible. If you are using a remote debugger (e.g. Chrome), switch to an on-device debugger (e.g. Flipper) instead. 동일한 이슈인것 같은데 mmkv3 베타 버전에서 잘된다고하네요 확인이 필요할것 같습니다 |
엇.. Android, iOS 실행되는걸 모두 체크를 했는데, 혹시 pod install 하셨을까요? |
네 pod install 했는데 일단 저도 다시 확인해보겠습니다 |
mmkv 사용시 remote debugging 기능이 불가능한게 맞네요 Flipper 를 사용하여 디버깅 하는것도 가능하다고는 하는데 |
chatSDK = SendbirdChat.init({ | ||
...chatInitParams, | ||
appId, | ||
newInstance: true, | ||
modules: [new GroupChannelModule(), new OpenChannelModule()], | ||
localCacheEnabled: true, | ||
useAsyncStorageStore: internalStorage as never, | ||
useMMKVStorageStore: isMMKVStorage ? (localCacheStorage as never) : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 혹시 as never 로 사용하는 이유가 있을까요?
as MMKV 가 더 명확한것 같아서요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
타입이 맞지 않아서, 강제로 지정하기 위한 용도라서 딱히 없습니다! 변경하도록 하게씁니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 remote debugging 을 키고 계셨군요, 릴리즈때 변경사항에 포함하는건 어떨까요? |
@@ -0,0 +1,3 @@ | |||
import { MMKV } from 'react-native-mmkv'; | |||
|
|||
export const mmkv = new MMKV(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리모트 디버깅 사용시 chatOptions 에서 AsyncStorage 로 변경해도 MMKV 인스턴스가 생성되며 Excpetion이 발생하고 있습니다. 아래와 같이 변경하는건 어떨까요?
import { MMKV } from 'react-native-mmkv';
import { LocalCacheStorage } from '@sendbird/uikit-react-native';
class DevLocalCacheStorage {
getString(_key: string): string | undefined {
return undefined;
}
set(_key: string, _value: boolean | string | number | Uint8Array): void {}
delete(_key: string): void {}
getAllKeys(): string[] {
return [];
}
}
const createLocalCacheStorageInstance = (): LocalCacheStorage => {
if (__DEV__) {
return new DevLocalCacheStorage();
}
return new MMKV();
};
export const localCacheStorage = createLocalCacheStorageInstance();
네 포함 시키면 좋을것 같습니다. 다만 걱정되는건 remote debugging 사용하는 고객들이 mmkv 적용된 버전 사용하고나서 저희쪽으로 이슈 문의를 계속 하지않을까? 라는 걱정이 듭니다. |
요게 AsyncStorage 의 블록 사이즈(6mb) 이슈 때문에 Android 에서 읽기에 실패하는 경우가 있어서 Chat SDK 에서 AsyncStorage 가 deprecated 하고 MMKV 로 변경을 한것이라서, 안따라가기에는 조금 애매할 것 같습니다. 고객한테도 계속 warning 이 뜰것이구요. new debugger: react-native-community/discussions-and-proposals#733 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #185 +/- ##
==========================================
- Coverage 13.07% 13.01% -0.07%
==========================================
Files 334 334
Lines 7434 7470 +36
Branches 1919 1942 +23
==========================================
Hits 972 972
- Misses 6461 6497 +36
Partials 1 1 ☔ View full report in Codecov by Sentry. |
External Contributions
This project is not yet set up to accept pull requests from external contributors.
If you have a pull request that you believe should be accepted, please contact
the Developer Relations team [email protected] with details
and we'll evaluate if we can setup a CLA to allow for the contribution.
For Internal Contributors
CLNP-3879
Description Of Changes
Types Of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that apply_