Skip to content

fix: encode empty WebStorage tags as JSON object for Buggregator#7

Open
SavKS wants to merge 1 commit into
spiral-packages:masterfrom
SavKS:fix/webstorage-empty-tags-json-object
Open

fix: encode empty WebStorage tags as JSON object for Buggregator#7
SavKS wants to merge 1 commit into
spiral-packages:masterfrom
SavKS:fix/webstorage-empty-tags-json-object

Conversation

@SavKS

@SavKS SavKS commented May 26, 2026

Copy link
Copy Markdown

Summary

  • Problem: WebStorage sent empty tags as JSON []. Buggregator returns 400 (cannot unmarshal array into ... tags of type map[string]interface{}), so profiles from Laravel (maantje/xhprof-buggregator-laravel) never appeared.
  • Fix: serialize empty tags as {} (stdClass / empty object) instead of [].
  • Test: WebStorageTest asserts empty tags encode as "tags":{} and non-empty tags are unchanged.

Test plan

  • vendor/bin/phpunit
  • Manual: curl with tags:[] → 400, tags:{} → 200 against Buggregator

Buggregator rejects profiles when tags is [] because it expects a map.
Send {} for empty tags so Laravel/xhprof integrations can store profiles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant