You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 596eced
Browse filesBrowse the repository at this point in the historyBrowse files
Documentation-only improvements from the code-quality review (#81)
No behavior change; comments only. Build, go vet, staticcheck, golangci-lint
and the full -race / -tags debug -race suites are unaffected.
- Element queue helpers (SetAttr/SetInner/...): replace the misleading "call
only during JawsRender/JawsUpdate" line with the accurate deferred-delivery
contract and point to Request.Dirty for the event-driven path; expand the
Element.queue chokepoint doc likewise.
- contracts.go: fix the dangling [Element.Context]/[Element.Session] doc-links
to [Request.Context]/[Request.Session]; give Container.JawsContains a leading
synopsis sentence; note the deleted-Element no-op on Renderer.JawsRender and
Updater.JawsUpdate.
- eventhandler.go: document ErrEventHandlerPanic's Unwrap semantics and that the
recorded Type is the UI object type, which may differ from the handler that
panicked.
- request.go: split Request.Get/Set synopses and add [Session.Get]/[Session.Set]
links; document that AlertError also logs; note that Request methods are not
nil-safe (unlike Session); record the recycle-window reasoning on
appendDirtyTags and the retained-back-pointer/frozen invariant in clearLocked.
- broadcast.go: document distributeDirt's deliberate pending-buffer and
recycle-window behavior.
- jaws.go / session.go: note the CSPRNG panic condition on NewRequest/NewSession.
- errvalueunchanged.go: name the JawsSet/JawsSetPath convention that returns it
and why the sentinel lives in this package.
- element.go: link the public [CallEventHandlers] entry from the appendHandlers
note.
Copy file name to clipboardExpand all lines: request.go
+26-6Lines changed: 26 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,12 @@ type ConnectFn = func(rq *Request) error
42
42
//
43
43
// Note that we have to store the context inside the struct because there is no call chain
44
44
// between the Request being created and it being used once the WebSocket is created.
45
+
//
46
+
// Unlike [Session], whose methods are nil-safe, Request methods are not safe to call on a
47
+
// nil *Request: a Request is always obtained from [Jaws.NewRequest] or [Jaws.UseRequest]
48
+
// and is never legitimately nil. The nil-receiver guards on [Request.Log] and
49
+
// [Request.MustLog] exist only so a nil Request can be rendered into error text, not as a
50
+
// public nil-safe contract.
45
51
typeRequeststruct {
46
52
Jaws*Jaws// (read-only) the JaWS instance the Request belongs to
47
53
JawsKey key.Key// (read-only) random key identifying this Request in the WebSocket URI and the broadcast/tail target; read under mu by the identity check (destKey, wantMessage) and the render path (JawsKeyString, HeadHTML)
0 commit comments