sourced-message 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80569ac57d96516a6efd3bd8c09ef862a7c48d9e661fb82404476608995c6350
4
- data.tar.gz: a480b3c5007cab3ad87f242a5828a548e294150ef2ad65b5afdc2dc98d53423c
3
+ metadata.gz: ed1d286c9bef9ab9e75beabbfbb49b55c6344cc72de2bdb205fe99310772ec2d
4
+ data.tar.gz: 87ac27cc91b21844ec3f2a589812c4cf1fd5c0474c20d30583da2606c91df230
5
5
  SHA512:
6
- metadata.gz: bae04d8962a7e19f8f21985b674b29e0ddb90987934a51504e8eeba4e357b7925b983c4e9cee10b719b0598ecae963af0dccbd79efb0679a44ace463184e6c37
7
- data.tar.gz: df823ccc2eab96eaddba05255f0776b069dfa57004bb58f2337f9de8aeedd29fe3d30ed04ed7e72ac0211c0e6195110cb19bbd735014fefd76013aa975349f24
6
+ metadata.gz: 486e6c9c81391ac43ee46c705a8662bd4263578ce687fe7d5c7555a5c48c345ebbeb31691c2b7cc081e92030567bdeece3198c1cc8fe225811fa409b97b16dfd
7
+ data.tar.gz: ad1f09cf84d7853d86d0b4586bae17e307a2391a1efd551ae839c430cd3240485daadd4cd178da93c63f41d55a6f2600f439c4f9f57e5ff26d061b5829cefd38
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ - `Message#created_at` is kept to the microsecond, the precision `Plumb::Codec::JSON`
4
+ encodes, so a message equals itself read back from JSON. On Linux, `Time.now` has
5
+ nanoseconds, so a message and its stored copy differed in `created_at`. Every way of
6
+ setting it is truncated: the default, a `created_at:` passed in, `#with` and `#at`.
3
7
  - `Message#at` with a duration string (`'1h30m'`) raised `ArgumentError` ("Cannot
4
8
  determine timezone from \"BST\"") in the hour the clocks go back. The duration's
5
9
  seconds are now added to `Time.now`, exactly. Durations in months or years, which
@@ -22,7 +22,7 @@ module Sourced
22
22
  # +Sourced::Message.registry[type]+ resolves a type registered under any
23
23
  # subclass. Resolve from this root to see the whole tree.
24
24
  class Message < Plumb::Types::Data
25
- VERSION = '0.5.2'
25
+ VERSION = '0.5.3'
26
26
 
27
27
  EMPTY_ARRAY = [].freeze
28
28
 
@@ -62,7 +62,9 @@ module Sourced
62
62
  attribute :type, Types::String.present
63
63
  attribute? :causation_id, Types::UUID::V4
64
64
  attribute? :correlation_id, Types::UUID::V4
65
- attribute :created_at, LaxTime.default { Time.now }
65
+ # Kept to the microsecond, as Plumb::Codec::JSON encodes it, so a message equals
66
+ # itself read back from JSON (Linux clocks have nanoseconds).
67
+ attribute :created_at, LaxTime.default { Time.now }.transform(::Time) { |t| t.floor(6) }
66
68
  attribute :metadata, Types::Metadata.default(Plumb::BLANK_HASH)
67
69
  # Envelope, not payload: {#correlate} leaves the target's tags alone, so they
68
70
  # never pass on to messages produced in reaction.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sourced-message
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Celis