Fix scheduled action panic with null event payload (#37459)#37466
Merged
wxiaoguang merged 1 commit intogo-gitea:release/v1.26from Apr 28, 2026
Merged
Fix scheduled action panic with null event payload (#37459)#37466wxiaoguang merged 1 commit intogo-gitea:release/v1.26from
wxiaoguang merged 1 commit intogo-gitea:release/v1.26from
Conversation
This fixes the scheduled action panic when an event payload is JSON `null` by initializing the payload map before adding `schedule`. It also adds regression coverage for the null-payload case. Fixes go-gitea#37447. Testing: - `go test -tags 'sqlite sqlite_unlock_notify' ./services/actions -run '^TestWithScheduleInEventPayload$' -count=1` - Local note: this agent ran the command as root with a temporary `GITEA_TEST_CONF=custom/conf/app-test-root.ini` file that only set `I_AM_BEING_UNSAFE_RUNNING_AS_ROOT = true`. Authorship: cyphercodes; AI assistance disclosed: Hermes Agent (GPT-5.5). --------- Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com> Co-authored-by: Hermes Agent (GPT-5.5) <hermes-agent@users.noreply.github.com> Co-authored-by: Nicolas <bircni@icloud.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com> Co-authored-by: Giteabot <teabot@gitea.io>
silverwind
approved these changes
Apr 28, 2026
wxiaoguang
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #37459 by @cyphercodes
This fixes the scheduled action panic when an event payload is JSON
nullby initializing the payload map before addingschedule. It also adds regression coverage for the null-payload case.Fixes #37447.
Testing:
go test -tags 'sqlite sqlite_unlock_notify' ./services/actions -run '^TestWithScheduleInEventPayload$' -count=1GITEA_TEST_CONF=custom/conf/app-test-root.inifile that only setI_AM_BEING_UNSAFE_RUNNING_AS_ROOT = true.Authorship: cyphercodes; AI assistance disclosed: Hermes Agent (GPT-5.5).