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

enbility / spine-go / 33386485123
93%

Build:
DEFAULT BRANCH: dev
Ran 31 Aug 2026 11:21AM UTC
Jobs 1
Files 63
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Aug 2026 11:20AM UTC coverage: 92.939% (+0.007%) from 92.932%
33386485123

push

github

web-flow
fix(spine): nil-check remoteFeature in SubscribeToRemote/BindToRemote (minimal patch for #87) (#90)

Fixes #87. Minimal-scope alternative to #88.

## Problem

`FeatureLocal.SubscribeToRemote` and `BindToRemote` dereference
`remoteDevice.FeatureByAddress()` without a nil-check. When a remote
device advertises a feature address that the local entity model has not
yet materialized, `FeatureByAddress` returns `nil` and the subsequent
`.Type()` / `.Role()` call panics inside the `spine.(*events).Publish`
goroutine, killing the process.

Reproduced reliably in `eebus-go` EG-LPC use case startup:
`lpc.(*LPC).connected()` runs `Subscribe()` while the remote's
`LoadControl` feature has not yet been published.

```
panic: runtime error: invalid memory address or nil pointer dereference
spine.(*FeatureLocal).SubscribeToRemote
    spine/feature_local.go:451
eebus-go/features/client.(*Feature).Subscribe
eebus-go/usecases/eg/lpc.(*LPC).connected
    usecases/eg/lpc/events.go:76
created by spine.(*events).Publish
```

## Fix

Mirror the existing nil-check pattern used immediately above (for
`remoteAddress.Device` and `remoteDevice`): return a proper
`*model.ErrorType("feature not found")` that the calling code already
handles as a debug-level non-fatal event.

## Scope

- 6 production lines in `spine/feature_local.go`
- 2 new test cases (`TestSubscribeToRemote_NilFeature`,
`TestBindToRemote_NilFeature`)
- No behavioural change for the non-nil path

## Relation to #88

#88 from @SAY-5 also addresses #87 with the same conceptual approach
(nil-check + early error return), but additionally contains a wider
refactor (199 changed files, +23573/-4189 LoC). The maintainer may
prefer either path:

- **This PR**: minimal-surface fix, easy to review, focused on the
immediate panic
- **#88**: larger refactor that includes this fix as part of broader
changes

Happy to defer to whichever direction you'd like to land — the issue
itself is what matters.

## Test

`go test ./spine/.... (continued)

6 of 6 new or added lines in 1 file covered. (100.0%)

6265 of 6741 relevant lines covered (92.94%)

25377.97 hits per line

Jobs
ID Job ID Ran Files Coverage
1 33386485123.1 31 Aug 2026 11:21AM UTC 63
92.94
GitHub Action Run
Source Files on build 33386485123
  • Tree
  • List 63
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33386485123
  • ff669af4 on github
  • Prev Build on dev (#33385929727)
  • Next Build on dev (#35615839091)
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