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

StoneCypher / jssm / 94065656f6892f7ebb2e65b990ce334cdef6c8e6 / 2
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 09 Jan 2026 01:10AM UTC
Files 15
Run time 0s
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

09 Jan 2026 01:08AM UTC coverage: 99.822% (-0.06%) from 99.88%
94065656f6892f7ebb2e65b990ce334cdef6c8e6.2

push

github

StoneCypher
Add version checking to deserialize to refuse future versions

This commit implements version compatibility checking in the deserialization
process to prevent loading data from future versions of the library.

Changes made:

1. Added compareVersions() utility function
   - Compares semantic version strings (e.g., "5.104.2")
   - Returns negative/0/positive for less than/equal/greater than
   - Handles versions with different numbers of components
   - Fully documented with DocBlock comments and examples

2. Enhanced deserialize() function
   - Now checks if serialized data is from a future version
   - Throws clear error message if version is too new
   - Error includes both versions and upgrade guidance
   - Updated DocBlock documentation with @throws annotation
   - Added comprehensive usage examples

3. Comprehensive test coverage (14 new tests)
   - Tests for refusing future major/minor/patch versions
   - Tests for accepting same and older versions
   - Tests for error message content
   - Tests for successful deserialization with version check
   - Tests for compareVersions utility behavior
   - All 5075 tests pass successfully

Why this is important:
- Prevents data corruption from incompatible future formats
- Provides clear error messages to users
- Follows semantic versioning best practices
- Maintains backward compatibility (older versions still load)

The implementation is defensive and user-friendly, refusing to deserialize
data that might contain features or structures the current version doesn't
understand, while clearly communicating what the user needs to do (upgrade).

Fixes issue #1010, see https://github.com/StoneCypher/fsl/issues/1010

524 of 526 branches covered (99.62%)

Branch coverage included in aggregate %.

1155 of 1156 relevant lines covered (99.91%)

2333.52 hits per line

Source Files on job 94065656f6892f7ebb2e65b990ce334cdef6c8e6.2
  • Tree
  • List 15
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 94065656
  • 94065656 on github
  • Prev Job for on VersionCheckDeserialize_1010 (#464d03b0c0e0141c6e64018155438cb79c276527.3)
  • Next Job for on VersionCheckDeserialize_1010 (#5465a4c0c4a04bc22b1ac991c8132badaaac791f.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc