-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Update documentation to disable duration settings with -1 instead of 0 #19647
Conversation
To turn off the notification endpoint polling, the value should be set to -1, not 0.
This comment was marked as off-topic.
This comment was marked as off-topic.
// in go code
"MinTimeout": int(setting.UI.Notification.MinTimeout / time.Millisecond) // and in JS code
if (notificationSettings.MinTimeout <= 0) {
return;
} |
Yes, if 0 works as well, it indeed is not breaking. |
0 does not work. I've put a console log of notificationSettings.MinTimeout in the JS code and it prints 10000 when MIN_TIMEOUT is set to 0. When MIN_TIMEOUT is set to -1, it prints 0. Note that setting.UI.Notification.MinTimeout is of type time.Duration, I'm not sure where to find the conversion code from string to time.Duration? |
What about these? I think it's likely these duration properties may also not work as documented? gitea/docs/content/doc/advanced/config-cheat-sheet.en-us.md Lines 261 to 262 in 8adba93
gitea/docs/content/doc/advanced/config-cheat-sheet.en-us.md Lines 289 to 290 in 8adba93
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should look into the problem. IMO 0
is a general value for defaults.
I will take a look at it, just put a request change mark here temporarily
It's a bug in the Then, at the moment, all I would suggest to fix it from upstream, instead of tolerate and bypass the problem ......... // around ini/struct.go:181
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
// ParseDuration will not return err for `0`, so check the type name
if vt.Name() == "Duration" {
durationVal, err := key.Duration()
if err != nil {
if intVal, err := key.Int64(); err == nil {
field.SetInt(intVal)
return nil
}
return wrapStrictError(err, isStrict)
}
if isPtr {
field.Set(reflect.ValueOf(&durationVal))
} else if int64(durationVal) > 0 { // 🐞 BUG HERE, even the key/value(0) exists, the ini code ignore the value
field.Set(reflect.ValueOf(durationVal))
}
return nil
} |
After reading the ini code again, I do not have confidence that such behavior could be fixed soon if the So, at the moment, maybe all document should be updated accordingly, use |
@wxiaoguang That sounds to me as if this PR should indeed be marked |
IMO there is no code change, it doesn't break anything, it's a document bug fix only. And the fixes also works for 1.16. If users do not find this bug (not affected), they do not need to change their configuration ...... |
🚀 |
* giteaofficial/main: Use better message for consistency check (go-gitea#19672) Fix new release from tags list UI (go-gitea#19670) Update go deps (go-gitea#19665) [doctor] Add check/fix for bogus action rows (go-gitea#19656) [skip ci] Updated translations via Crowdin Add tooltip to pending PR comments (go-gitea#19662) Add Webfinger endpoint (go-gitea#19462) Update documentation to disable duration settings with -1 instead of 0 (go-gitea#19647) Set the LastModified header for raw files (go-gitea#18356) Don't select join table's columns (go-gitea#19660)
go-gitea#19647) To turn off the notification endpoint polling, the value should be set to -1, not 0.
To turn off the notification endpoint polling, the value should be set to -1, not 0.