You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can reproduce it. I have to pause my investigation for now.
It is true, that the restrictor for meeting/A is Anyone can see it. Even anonymous.. But for a relation field, the user has to have to permission for both ends. The other end in this case is restriction_mode committee/A which is basically: if he is in committee/user_ids.
I can not see in your example requests, that the test user gets added to that field. I am not sure, if the backend action meeting.create should add the user to the committee/2/user_ids and if it acutely did it.
So it has to be a caching or a message_bus problem.
Ok: I found the problem. It has nothing to do with the autoupdate or openslides-go, but it is an error in our schema.sql
When the new meeting is created, it does not sends the value "committee/X/user_ids" to the message_bus. You can reproduce it without the autoupdate service, directly with postgres, by calling LISTEN os_notify; and the looking at the message_bus table. For example with SELECT DISTINCT operation, fqid, updated_fields FROM os_notify_log_t WHERE xact_id='777'::xid8;.
A lot of keys are send to the message bus. But for the committee, you only get this value:
update | committee/2 | {meeting_ids}
The correct value would be {meeting_ids, user_ids}
This is a real bug, that could effect production. This has nothing to do with the immutable-branch. The error exists in main. To reproduce it in main, you have to be sure, that the value committee_id/X/user_ids is in the cache of the autoupdate-service. If you update the value by creating a new meeting, the autoupdate-service will not be informed about it.
The reason, why the test does pass in main is, that the immutable PR changes the way, how values get cached from the autoupdate-service. The old system only caches values, that where requested before, the new system caches all values from the message_bus, to have a more complete snapshot. So when the committee gets created, the old system did not cache it, but with immutable, it does.
@hjanott can you have a look at the schema.sql and why the field committee/user_ids does not get triggered on meeting.create.
I don't have much time now. All I can see is that we are creating a log trigger with this SELECT committee_id FROM meeting_t WHERE id = ($1).meeting_id on the meeting table.
I only see this line on triggers on meeting_user. The issue is on meeting create. I am not sure, if a meeting_user gets created for the admin user when a meeting is created
The backend first created the meeting_user and afterwards the meeting. The triggers are run directly and not after the commit. This is the trigger:
CREATE TRIGGER tr_log_i_committee_user_ids_from_meeting_user_t BEFORE INSERT ON meeting_user_t
FOR EACH ROW EXECUTE FUNCTION log_iu_modified_calculated_id_array_field('committee', '', 'SELECT committee_id FROM meeting_t WHERE id = ($1).meeting_id', 'user_ids', 'user_id', '');
It selects the committee_id from the meeting-collection. But since the meeting does not exist, there is nothing to trigger.
Either the backend has to create the collections in the correct order, or the triggers have to be rewritten to run after a commit ( DEFERRABLE INITIALLY DEFERRED)
To my knowledge DEFERRABLE INITIALLY DEFERRED works only for constraint triggers, which these aren't.
No matter however, because, in fact, we already have a feature that is supposed to deal with this. The log_triggers-key in our yml definitions.
Turns out, that for the user/committee_ids and committee/user_ids relation, these aren't configured correctly.
Will be fixing that as part of OpenSlides/openslides-backend#3853.
Activity
bastianjoel commentedon Nov 9, 2026
Using example-data.json as initial data this is the exact reproduction path from the integration test:
Now the request is lacking the
committee_idfield:single=1does not seem to have any effect on the issue.ostcar commentedon Nov 9, 2026
I can reproduce it. I have to pause my investigation for now.
It is true, that the restrictor for
meeting/AisAnyone can see it. Even anonymous.. But for a relation field, the user has to have to permission for both ends. The other end in this case is restriction_modecommittee/Awhich is basically:if he is in committee/user_ids.I can not see in your example requests, that the test user gets added to that field. I am not sure, if the backend action
meeting.createshould add the user to thecommittee/2/user_idsand if it acutely did it.I will test it later.
ostcar commentedon Nov 9, 2026
The value is in the database
But the autoupdate does not see it, even as superadmin:
After a restart of the autoupdate, the field is correct:
So it has to be a caching or a message_bus problem.
Ok: I found the problem. It has nothing to do with the autoupdate or openslides-go, but it is an error in our schema.sql
When the new meeting is created, it does not sends the value "committee/X/user_ids" to the message_bus. You can reproduce it without the autoupdate service, directly with postgres, by calling
LISTEN os_notify;and the looking at the message_bus table. For example withSELECT DISTINCT operation, fqid, updated_fields FROM os_notify_log_t WHERE xact_id='777'::xid8;.When creating a new meeting with an admin:
A lot of keys are send to the message bus. But for the committee, you only get this value:
The correct value would be
{meeting_ids, user_ids}This is a real bug, that could effect production. This has nothing to do with the immutable-branch. The error exists in main. To reproduce it in main, you have to be sure, that the value
committee_id/X/user_idsis in the cache of the autoupdate-service. If you update the value by creating a new meeting, the autoupdate-service will not be informed about it.The reason, why the test does pass in main is, that the immutable PR changes the way, how values get cached from the autoupdate-service. The old system only caches values, that where requested before, the new system caches all values from the message_bus, to have a more complete snapshot. So when the committee gets created, the old system did not cache it, but with immutable, it does.
@hjanott can you have a look at the schema.sql and why the field
committee/user_idsdoes not get triggered on meeting.create.hjanott commentedon Nov 10, 2026
I don't have much time now. All I can see is that we are creating a log trigger with this
SELECT committee_id FROM meeting_t WHERE id = ($1).meeting_idon the meeting table.ostcar commentedon Nov 10, 2026
I only see this line on triggers on meeting_user. The issue is on meeting create. I am not sure, if a meeting_user gets created for the admin user when a meeting is created
ostcar commentedon Nov 10, 2026
Ok, a meeting_user should be created: https://github.com/OpenSlides/openslides-backend/blob/fc72d6b5d739a830216897dd533f996dbbbab75c/openslides_backend/action/actions/meeting/create.py#L190
And therefore the trigger on meeting_user_create should be enought. Here is the trigger:
https://github.com/OpenSlides/openslides-meta/blob/fa74ec5e51d8cbb2a081f5f84ef1ef0f66637e8f/dev/sql/schema_relational.sql#L4485-L4486
Ok. I found the Problem.
The backend first created the meeting_user and afterwards the meeting. The triggers are run directly and not after the commit. This is the trigger:
It selects the
committee_idfrom the meeting-collection. But since the meeting does not exist, there is nothing to trigger.Either the backend has to create the collections in the correct order, or the triggers have to be rewritten to run after a commit (
DEFERRABLE INITIALLY DEFERRED)luisa-beerboom commentedon Nov 11, 2026
To my knowledge
DEFERRABLE INITIALLY DEFERREDworks only for constraint triggers, which these aren't.No matter however, because, in fact, we already have a feature that is supposed to deal with this. The
log_triggers-key in our yml definitions.Turns out, that for the
user/committee_idsandcommittee/user_idsrelation, these aren't configured correctly.Will be fixing that as part of OpenSlides/openslides-backend#3853.