소스 검색

[RN] Fix a "TypeError: Cannot read property handlers of undefined" in ImageCache

With some of the preceding commits in the "multiplying remote
thumbnails" story line, I started hitting this error with 100%
reproducibility:

1. Have a remote participant prepared in conferenceA. Web will do as
well.
2. On iOS prepare to join conferenceB in Safari and use the same device
for step 3.
3. Join conferenceA on the iOS device from step 2 with audio-only. The
audio-only is so that avatars are always visible. Wait for the remote
participant prepared in step 1 to appear.
4. Switch to Safari and hit "Continue in the app" to have the app leave
conferenceA and join conferenceB.

What happens:
After the iOS device joins conferenceB in the Jitsi Meet app, the local
participant is on the large video (as expected) but the avatar of the
local participant is the default audo-generated auto-colored
placeholder. That's because this error was hit and the avatar couldn't
be "fetched".
j8
Lyubo Marinov 7 년 전
부모
커밋
2ecacf6c3e
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9
    3
      react/features/mobile/image-cache/middleware.js

+ 9
- 3
react/features/mobile/image-cache/middleware.js 파일 보기

@@ -1,7 +1,6 @@
1 1
 /* @flow */
2 2
 
3 3
 import { APP_WILL_MOUNT } from '../../app';
4
-import { CONFERENCE_FAILED, CONFERENCE_LEFT } from '../../base/conference';
5 4
 import {
6 5
     getAvatarURL,
7 6
     getLocalParticipant,
@@ -37,8 +36,15 @@ const _PREFETCH_AVATAR_URLS = false;
37 36
 MiddlewareRegistry.register(({ getState }) => next => action => {
38 37
     switch (action.type) {
39 38
     case APP_WILL_MOUNT:
40
-    case CONFERENCE_FAILED:
41
-    case CONFERENCE_LEFT:
39
+        // XXX CONFERENCE_FAILED/LEFT are no longer used here because they
40
+        // are tricky to get right as detectors of the moments in time at which
41
+        // CachedImage is not used. Anyway, if ImageCache is to be cleared from
42
+        // time to time, SET_LOCATION_URL is a much easier detector of such
43
+        // opportune times. Fixes at least one 100%-reproducible case of
44
+        // "TypeError: Cannot read property handlers of undefined." Anyway, in
45
+        // order to reduce the re-downloading of the same avatars, eventually we
46
+        // decided to not clear during the runtime of the app (other that at the
47
+        // beginning that is).
42 48
         ImageCache && ImageCache.get().clear();
43 49
         break;
44 50
 

Loading…
취소
저장