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

fix: skip updateUserMessageReferences if channel is undefined #1249

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

arnautov-anton
Copy link
Contributor

Description of the changes, What, Why and How?

Fixes an issue where apps would crash due missing state on undefined channel when trying to update userChannelReferences.

Error in question:

TypeError: Cannot read properties of undefined (reading 'state')
node_modules/stream-chat/dist/browser.es.js at line 6861:31

    _defineProperty(this, "_updateUserMessageReferences", function (user) {
      var refMap = _this.state.userChannelReferences[user.id] || {};

      for (var _channelID2 in refMap) {
        var _channel3 = _this.activeChannels[_channelID2];
        var state = _channel3.state;
        /** update the messages from this user. */

        state === null || state === void 0 ? void 0 : state.updateUserMessages(user);
      }
    });

Copy link
Contributor

Size Change: +44 B (0%)

Total Size: 352 kB

Filename Size Change
dist/browser.es.js 76 kB +10 B (0%)
dist/browser.full-bundle.min.js 46.4 kB +8 B (0%)
dist/browser.js 76.9 kB +9 B (0%)
dist/index.es.js 76 kB +9 B (0%)
dist/index.js 77 kB +8 B (0%)

compressed-size-action

@arnautov-anton arnautov-anton merged commit e88b8ec into master Mar 4, 2024
5 of 6 checks passed
@arnautov-anton arnautov-anton deleted the fix/skip-update-on-undef-channel branch March 4, 2024 16:21
@github-actions github-actions bot mentioned this pull request Mar 4, 2024
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.

4 participants