Skip to content

fix: output mmsi as string#394

Open
sbender9 wants to merge 5 commits intomasterfrom
mmsi-as-string
Open

fix: output mmsi as string#394
sbender9 wants to merge 5 commits intomasterfrom
mmsi-as-string

Conversation

@sbender9
Copy link
Member

@sbender9 sbender9 commented Feb 5, 2026

fixes #391

@sbender9 sbender9 added the fix Something isn't working label Feb 5, 2026
@sbender9
Copy link
Member Author

sbender9 commented Feb 5, 2026

@tkurki this change is causing a test to fail in n2k-signalk

       no User Id produces no output:

      AssertionError: expected 'object' to equal 'undefined'
      + expected - actual

      -object
      +undefined
      
      at Context.<anonymous> (test/129038_ais_class_a.js:87:22)
      at process.processImmediate (node:internal/timers:485:21)

I am inclined to fix the n2k-signalk since canboatjs and canboat output "000000000" in case. Agreed?

@tkurki
Copy link
Collaborator

tkurki commented Feb 5, 2026

Sure!

@sbender9
Copy link
Member Author

sbender9 commented Feb 5, 2026

After looking at n2k-signalk, I am now thinking of having the User ID be undefined in this case. That way we won't have backwards compatibility issues.

@tkurki
Copy link
Collaborator

tkurki commented Feb 5, 2026

Or null? Either may break code that expects a string.

@tkurki
Copy link
Collaborator

tkurki commented Feb 5, 2026

I mean number.

@sbender9
Copy link
Member Author

sbender9 commented Feb 5, 2026

Yeah, looks like I would have to return 0 in this case to make the existing n2k-signalk code work. Looks like everything else is ok because n2k-signalk currently calls .toString().

Removed the reference to 'typescript' branch for checkout.
Removed the build step for signalk-to-nmea2000 in the CI workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MMSIs should be output as strings, with zero prefixes preserved

2 participants