Skip to content

Log missing keys on debug level#270

Merged
bastianjoel merged 2 commits into
OpenSlides:mainfrom
bastianjoel:Log-missing-keys-to-debug-level
Jun 1, 2026
Merged

Log missing keys on debug level#270
bastianjoel merged 2 commits into
OpenSlides:mainfrom
bastianjoel:Log-missing-keys-to-debug-level

Conversation

@bastianjoel
Copy link
Copy Markdown
Member

resolves #269

@bastianjoel bastianjoel requested a review from ostcar May 28, 2026 09:53
@Elblinator Elblinator requested a review from m-schieder May 28, 2026 10:07
@Elblinator Elblinator added the bug label May 28, 2026
@Elblinator Elblinator added this to the 4.4 milestone May 28, 2026
Copy link
Copy Markdown
Member

@ostcar ostcar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its ok for me. But I think, this will create strange messages, when there are more then one invalid keys in the message bus.

I would propose, that you change createKeyList that it does not return an error anymore, but as a second argument a list of invalid keys.

func createKeyList(collection string, id int, fields []string) ([]dskey.Key, []dskey.Key)

Then you can create a better debug-error message with it.

It also makes it more clear, that you don't ignore a generic error, but only invalid keys.

@ostcar
Copy link
Copy Markdown
Member

ostcar commented May 29, 2026

Its ok for me. But I think, this will create strange messages, when there are more then one invalid keys in the message bus.

I would propose, that you change createKeyList that it does not return an error anymore, but as a second argument a list of invalid keys.

func createKeyList(collection string, id int, fields []string) ([]dskey.Key, []dskey.Key)

Then you can create a better debug-error message with it.

It also makes it more clear, that you don't ignore a generic error, but only invalid keys.

Of cause, it can not return invalid keys, but only the invalid fields:
func createKeyList(collection string, id int, fields []string) ([]dskey.Key, []string)

@Elblinator Elblinator assigned bastianjoel and unassigned m-schieder Jun 1, 2026
@bastianjoel
Copy link
Copy Markdown
Member Author

bastianjoel commented Jun 1, 2026

I would propose, that you change createKeyList that it does not return an error anymore, but as a second argument a list of invalid keys.

I prefer not to do that right now as IMHO this would also mean that we should change FromParts return value to (Key, bool). This however requires changes in other services. Right now it returns an error and therefore we should pass that error in case of any future changes.

@bastianjoel bastianjoel enabled auto-merge (squash) June 1, 2026 14:52
@bastianjoel bastianjoel merged commit d0dd033 into OpenSlides:main Jun 1, 2026
1 check passed
@bastianjoel bastianjoel deleted the Log-missing-keys-to-debug-level branch June 1, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weird behavour if user who voted is deleted

4 participants