• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

romshark / datapages / 37042520297

02 Oct 2026 05:41PM UTC coverage: 40.523% (-0.04%) from 40.562%
37042520297

push

github

romshark
fix: Refuse subject fields that misroute events

- fix: Refuse a second datapages.SubjectUser field on an event in
  datapages lint and gen. A stream subscribes by one user position,
  the first one:

      // EventDMed is "dmed"
      type EventDMed struct {
          To, Cc datapages.SubjectUser

          Text string `json:"text"`
      }

  Dispatching EventDMed{To: "alice", Cc: "bob"} publishes to
  dmed.alice.bob, but every stream subscribes to dmed.<user>.*. Bob
  never receives the event, and alice receives it whatever Cc holds.

- fix: Refuse an event field whose type holds datapages.SubjectUser,
  datapages.Subject or datapages.SubjectStateID in a slice, array, map,
  pointer or channel. Such a field looks like a list of recipients but
  is a payload field, which leaves the event without the segment:

      // EventDirectMessage is "dm"
      type EventDirectMessage struct {
          Recipients []datapages.SubjectUser `json:"recipients"`

          Text string `json:"text"`
      }

  EventDirectMessage has no subject field. Dispatching it publishes to
  dm, and every stream of a page handling it receives the message,
  not only the listed recipients. Rewrite the Dispatcher example to
  dispatch once per participant instead of setting
  Recipients: room.ParticipantIDs.

33 of 79 new or added lines in 5 files covered. (41.77%)

20 existing lines in 3 files now uncovered.

14722 of 36330 relevant lines covered (40.52%)

543.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.8
/runtime/httpserve/core.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc