Giter Club home page Giter Club logo

event-store-messaging's People

Contributors

keisaacson avatar litch avatar ntl avatar sbellware avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

event-store-messaging's Issues

The tests on this library should be executable.

I pulled this repo, bundled, and get this.

% LOG_LEVEL=info ruby test/spec.rb
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
/Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/event_store-client-http-0.1.1/lib/event_store/client/http/controls.rb:1:in `require': cannot load such file -- controls (LoadError)
    from /Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/event_store-client-http-0.1.1/lib/event_store/client/http/controls.rb:1:in `<top (required)>'
    from /Users/litch/code/obsidian/event-store-messaging/lib/event_store/messaging/controls.rb:1:in `require'
    from /Users/litch/code/obsidian/event-store-messaging/lib/event_store/messaging/controls.rb:1:in `<top (required)>'
    from /Users/litch/code/obsidian/event-store-messaging/test/test_init.rb:11:in `require'
    from /Users/litch/code/obsidian/event-store-messaging/test/test_init.rb:11:in `<top (required)>'
    from test/spec.rb:1:in `require_relative'
    from test/spec.rb:1:in `<main>'

I added controls to the Gemfile, and bundled, but got a new error.

% LOG_LEVEL=info ruby test/spec.rb
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
/Users/litch/code/obsidian/event-store-messaging/lib/event_store/messaging/controls/message.rb:46:in `time': uninitialized constant Controls::Time (NameError)
    from /Users/litch/code/obsidian/event-store-messaging/lib/event_store/messaging/controls/message.rb:57:in `example'
    from /Users/litch/code/obsidian/event-store-messaging/test/spec/client_integration/expected_version.rb:7:in `block in <top (required)>'
    from /Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest/spec.rb:69:in `class_eval'
    from /Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest/spec.rb:69:in `describe'
    from /Users/litch/code/obsidian/event-store-messaging/test/spec/client_integration/expected_version.rb:3:in `<top (required)>'
    from /Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/runner-0.1.0/lib/runner/runner.rb:56:in `load'
    from /Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/runner-0.1.0/lib/runner/runner.rb:56:in `block in call'
    from /Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/runner-0.1.0/lib/runner/runner.rb:55:in `each'
    from /Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/runner-0.1.0/lib/runner/runner.rb:55:in `call'
    from /Users/litch/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/runner-0.1.0/lib/runner/runner.rb:33:in `call'
    from test/spec.rb:3:in `<main>'

I give up.

Metadata values of `""` should not blow up

When an EventStore message gets written without metadata explicitly, then read back out, the value of the metadata attribute is "".

This causes this library to blow up:

[2015-10-22T19:57:12.877-04:00] SetAttributes TRACE: Building (Receiver: #<EventStore::Messaging::Message::Metadata:0x007f9185ef5dd0>)
ArgumentError:  can't be used to set attributes. It can't be converted to Hash.
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/set_attributes-0.1.0/lib/set_attributes/set_attributes.rb:21:in `build'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/set_attributes-0.1.0/lib/set_attributes/set_attributes.rb:36:in `call'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/schema-0.1.0/lib/schema/data_structure.rb:20:in `set_attributes'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/schema-0.1.0/lib/schema/data_structure.rb:14:in `block in build'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/schema-0.1.0/lib/schema/data_structure.rb:13:in `tap'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/schema-0.1.0/lib/schema/data_structure.rb:13:in `build'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-messaging-0.1.0/lib/event_store/messaging/message/metadata.rb:18:in `build'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-messaging-0.1.0/lib/event_store/messaging/message/import/event_data.rb:15:in `call'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-messaging-0.1.0/lib/event_store/messaging/dispatcher.rb:76:in `build_message'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-entity_projection-0.1.0/lib/event_store/entity_projection/entity_projection.rb:93:in `build_message'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-messaging-0.1.0/lib/event_store/messaging/message_reader.rb:69:in `dispatch'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-messaging-0.1.0/lib/event_store/messaging/message_reader.rb:58:in `dispatch_event_data'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-messaging-0.1.0/lib/event_store/messaging/message_reader.rb:50:in `block in start'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-client-http-0.1.1/lib/event_store/client/http/event_reader.rb:60:in `call'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-client-http-0.1.1/lib/event_store/client/http/event_reader.rb:60:in `block in read_slice'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-client-http-0.1.1/lib/event_store/client/http/slice.rb:47:in `call'
... 13 levels...
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-client-http-0.1.1/lib/event_store/client/http/stream_reader/terminal.rb:7:in `each'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-client-http-0.1.1/lib/event_store/client/http/event_reader.rb:52:in `each_slice'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-client-http-0.1.1/lib/event_store/client/http/event_reader.rb:45:in `each'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-messaging-0.1.0/lib/event_store/messaging/message_reader.rb:49:in `start'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-entity_projection-0.1.0/lib/event_store/entity_projection/entity_projection.rb:82:in `call'
    from /Users/litch/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/event_store-entity_projection-0.1.0/lib/event_store/entity_projection/entity_projection.rb:70:in `call'

This is problematic.

We have attempted to alleviate this issue using refinements, but during the investigaton on how to do that, found that actually, there are several layers of nil protection for metadata.

So this library seems to have been built explicitly to tolerate "no" metadata, but there was a mistake in implementation that causes the "no" metadata case in real life to be misinterpreted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.