Giter Club home page Giter Club logo

Comments (10)

agnivade avatar agnivade commented on June 3, 2024 3

Going to close this as the PR is now reverted and cherry-picked.

from mattermost.

TwizzyDizzy avatar TwizzyDizzy commented on June 3, 2024 1

In my case there were roughly 800 occurrences (I am running a very small instance of Mattermost though). Executing your UPDATE statement seems to have fixed the issue. A colleague of mine also noted that leaving/re-joining the channel worked for him, though that is obviously no viable solution and does not even work for default channels, which do not allow leaving.

Thanks for addressing this!

Cheers
Thomas

from mattermost.

haivala avatar haivala commented on June 3, 2024 1

Is it safe to run that UPDATE ChannelMembers SET SchemeGuest = false WHERE SchemeGuest IS NULL; and it will not break anything in the future?

from mattermost.

streamer45 avatar streamer45 commented on June 3, 2024

@TwizzyDizzy Would you be able to confirm your current schema and the data for the specific entry failing?

Using psql client you can run:

\d+ channelmembers;

And

SELECT * FROM ChannelMembers WHERE ChannelId = 'girsg48543bqteppqphy97xhuw' AND UserId = '14ocq7hp3by9ic95f7zqr1mjcw';

from mattermost.

TwizzyDizzy avatar TwizzyDizzy commented on June 3, 2024

Yes, of course, here you go:

\d+ channelmembers;

                                                   Table "public.channelmembers"
       Column       |          Type          | Collation | Nullable | Default | Storage  | Compression | Stats target | Description 
--------------------+------------------------+-----------+----------+---------+----------+-------------+--------------+-------------
 channelid          | character varying(26)  |           | not null |         | extended |             |              | 
 userid             | character varying(26)  |           | not null |         | extended |             |              | 
 roles              | character varying(256) |           |          |         | extended |             |              | 
 lastviewedat       | bigint                 |           |          |         | plain    |             |              | 
 msgcount           | bigint                 |           |          |         | plain    |             |              | 
 mentioncount       | bigint                 |           |          |         | plain    |             |              | 
 notifyprops        | jsonb                  |           |          |         | extended |             |              | 
 lastupdateat       | bigint                 |           |          |         | plain    |             |              | 
 schemeuser         | boolean                |           |          |         | plain    |             |              | 
 schemeadmin        | boolean                |           |          |         | plain    |             |              | 
 schemeguest        | boolean                |           |          |         | plain    |             |              | 
 mentioncountroot   | bigint                 |           |          | 0       | plain    |             |              | 
 msgcountroot       | bigint                 |           |          | 0       | plain    |             |              | 
 urgentmentioncount | bigint                 |           |          |         | plain    |             |              | 
Indexes:
    "channelmembers_pkey" PRIMARY KEY, btree (channelid, userid)
    "idx_channelmembers_channel_id_scheme_guest_user_id" btree (channelid, schemeguest, userid)
    "idx_channelmembers_user_id_channel_id_last_viewed_at" btree (userid, channelid, lastviewedat)
Access method: heap

select statement

         channelid          |           userid           | roles | lastviewedat  | msgcount | mentioncount |                 notifyprops                  | lastupdateat  | schemeuser | schemeadmin | schemeguest | mentioncountroot | msgcountroot | urgentmentioncount 
----------------------------+----------------------------+-------+---------------+----------+--------------+----------------------------------------------+---------------+------------+-------------+-------------+------------------+--------------+--------------------
 girsg48543bqteppqphy97xhuw | 14ocq7hp3by9ic95f7zqr1mjcw |       | 1704458170326 |     2517 |            0 | {"desktop": "default", "mark_unread": "all"} | 1704458170326 | t          | t           |             |                0 |         1787 |                  0
(1 row)

Cheers
Thomas

from mattermost.

streamer45 avatar streamer45 commented on June 3, 2024

Thanks for confirming @TwizzyDizzy. This is an issue we are addressing. In the meantime you could technically fix it by updating the NULL schemeguest entries in those database rows.

I'd check how many these are:

SELECT COUNT(*) FROM ChannelMembers WHERE SchemeGuest IS NULL;

And consider updating them with:

UPDATE ChannelMembers SET SchemeGuest = false WHERE SchemeGuest IS NULL;

from mattermost.

streamer45 avatar streamer45 commented on June 3, 2024

Created https://mattermost.atlassian.net/browse/MM-56465 to track this issue internally.

from mattermost.

streamer45 avatar streamer45 commented on June 3, 2024

If anything it's half broken now. Yes it should be safe, but as usual with any DB operation, a backup is always recommended.

from mattermost.

haavardw avatar haavardw commented on June 3, 2024

Alternatively: Downgrading to 9.3.0 works as well (at least it did for us)

from mattermost.

streamer45 avatar streamer45 commented on June 3, 2024

Yes, downgrading can be an option as well given this is an issue introduced in 9.4

from mattermost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.