mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
fix: pre-v0.1 review feedback (#14)
* fix(sdk-android): add @JvmOverloads to Uatu.start Java callers can now invoke start(application) without supplying a Configuration, matching the Kotlin default-arg ergonomics. * feat(agent): add protocol_version to HELLO handshake ProtocolVersion=1 lives on Message and is set by Hello(). Server.Accept rejects mismatches with a clear error. SDK upgrades that don't change the wire format keep the same protocol_version; bump on breaking changes. * test(agent): assert protocol_version in Hello round-trip * feat(sdk-android): send protocol_version=1 in HELLO Mirrors agent.ProtocolVersion on the Go side. Bump in lockstep with the Go constant when the wire format breaks. * chore(sample-app): pull @uatu/spec from npm next tag Replaces the file: dep. Copy-paste users can now npm install against the registry. The release workflow publishes pre-release tags to npm dist-tag 'next', so the sample tracks the latest rc without manual version bumps. Lockfile currently resolves to 0.0.1-rc3.
This commit is contained in:
9 files changed
+67
-20
No files matched your search
@@ -21,13 +21,18 @@ const (
|
||||
|
||||
const MaxFrameSize = 16 * 1024 * 1024
|
||||
|
||||
// ProtocolVersion is the wire-format version. Bump on any breaking change
|
||||
// to the message schema or framing. Independent of the SDK release version.
|
||||
const ProtocolVersion = 1
|
||||
|
||||
type Message struct {
|
||||
Type MessageType `json:"type"`
|
||||
ID uint64 `json:"id,omitempty"`
|
||||
|
||||
Version string `json:"version,omitempty"`
|
||||
Platform string `json:"platform,omitempty"`
|
||||
AppPackage string `json:"app_package,omitempty"`
|
||||
ProtocolVersion int `json:"protocol_version,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Platform string `json:"platform,omitempty"`
|
||||
AppPackage string `json:"app_package,omitempty"`
|
||||
|
||||
Snapshots map[string]json.RawMessage `json:"snapshots,omitempty"`
|
||||
|
||||
@@ -39,7 +44,13 @@ type Message struct {
|
||||
}
|
||||
|
||||
func Hello(version, platform, appPackage string) Message {
|
||||
return Message{Type: MessageTypeHello, Version: version, Platform: platform, AppPackage: appPackage}
|
||||
return Message{
|
||||
Type: MessageTypeHello,
|
||||
ProtocolVersion: ProtocolVersion,
|
||||
Version: version,
|
||||
Platform: platform,
|
||||
AppPackage: appPackage,
|
||||
}
|
||||
}
|
||||
|
||||
func Pause(id uint64) Message { return Message{Type: MessageTypePause, ID: id} }
|
||||
|
||||
Reference in new issue
Block a user