All Versions
68
Latest Version
Avg Release Cycle
196 days
Latest Release
737 days ago

Changelog History
Page 7

  • v1.2.7 Changes

    Summary

    • ๐ŸŽ Convert server / client handler to instance members (performance)
  • v1.2.6 Changes

    Summary

    • ๐Ÿšš Move circuit breaker middleware only on client side circuit breaker
    • โž• Add tests for callback and promise error handling
    • โž• Add test for timeouts
    • ๐Ÿ”ง Circuit breaker is disabled by default and is configurable
  • v1.2.5 Changes

    Summary

    • ๐Ÿ“„ Implement circuit breaker
    • โž• Add tests for callback and promise error handling
  • v1.2.4 Changes

    Summary

    • ๐Ÿ›  Fixed util.pattern, don't concatenate objects to [object Object]
    • โž• Add tests
    • ๐Ÿ“‡ Rename some files to *.spec.js
    • โœ‚ Remove referrers meta$ property after recursion error to reduce payload size
  • v1.2.3 Changes

    Summary

    โš  Manage plugin dependencies. The dependencies attribute is used to identify the dependencies of a plugin. When the plugin could not be resolved a warning appears and an error is thrown. Does not provide version dependency which should be implemented using npm peer dependencies.

    exports.plugin = function myPlugin (options) {
      var hemera = this
    
      hemera.add({
        topic: 'math',
        cmd: 'add'
      }, (req, cb) => {
        cb(null, req.a + req.b)
      })
    }
    
    exports.options = {}
    
    exports.attributes = {
      dependencies: ['hemera-joi'],
      pkg: require('./package.json')
    }
    

    Error Message

     Plugin `myPlugin` requires `hemera-foo` as dependency. Please install with 'npm install --save hemera-foo'
    
  • v1.2.2 Changes

    Summary

    Throw only on NATS connection issues. Complete NATS connection error codes. Ensure that we cover all possible cases.

  • v1.2.1 Changes

    Summary

    Throw only on NATS connection issues. Authorization and Protocol issues are logged but don't lead to a process termination.

  • v1.2.0 Changes

    Summary

    ๐Ÿ”Œ hemera 1.2.0 is focused on error handling, plugin dependencies

    • โฌ†๏ธ Upgrade time: low - none to a couple of hours for most users
    • Complexity: low - requires following the list of changes to verifying their impact
    • Risk: medium - type checks on error will fail because the hemera error was stripped
    • Dependencies: low - existing plugins will work as-is

    ๐Ÿ’ฅ Breaking Changes

    ๐Ÿ”Œ You get the exact error you have sent. Errors are wrapped only for framework errors (Parsing errors, Plugin registration errors, Timeout errors) or logging.

    ๐Ÿ†• New Features

    • ๐Ÿ”ง Enable Server policy to abort requests when the server is not able to respond cause (max memory, busy event-loop). Example Configurable
    • ๐Ÿ”ง Long stack traces by default. Configurable
    • ๐Ÿ”ง Detect message loops (abort the request and return an error). Example Configurable
    • ๐Ÿ”Š Enrich errors logs with details (pattern, app-name, timestamp).
    • Track network hops in error to identify which clients was involved. Example

    Migration Checklist

    ๐Ÿ‘€ 1. Pull the wrapped error one level up. For any case except for: HemeraParseError, HemeraError "Error during plugin registration, TimeoutError"

    Old:

    hemera.add({
      topic: 'email',
      cmd: 'send'
    }, (resp, cb) => {
      cb(new Error('Uups'))
    })
    
    hemera.act({
      topic: 'email',
      cmd: 'send',
      email: '[email protected]',
      msg: 'Hi!'
    }, (err, resp) => {
      expect(err).to.be.exists()
      expect(err.name).to.be.equals('BusinessError')
      expect(err.message).to.be.equals('Business Error') 
      expect(err.cause.name).to.be.equals('Error')
      expect(err.cause.message).to.be.equals('Uups')
      hemera.close()
      done()
    })
    

    ๐Ÿ†• New:

    hemera.add({
      topic: 'email',
      cmd: 'send'
    }, (resp, cb) => {
      cb(new Error('Uups'))
    })
    
    hemera.act({
      topic: 'email',
      cmd: 'send',
      email: '[email protected]',
      msg: 'Hi!'
    }, (err, resp) => {
      expect(err).to.be.exists()
      expect(err.name).to.be.equals('Error')
      expect(err.message).to.be.equals('Uups')
      hemera.close()
      done()
    })
    

    ๐Ÿ”Š 2. All logs are wrapped with the correct Hemera error subclass BusinessError, FatalError ...

    ๐Ÿ”Œ 3. Plugin dependencies are declared with peerDependencies instead with dependencies property in the plugin.

    Old:

    exports.attributes = {
      dependencies: ['hemera-joi']
      pkg: require('./package.json')
    }
    

    ๐Ÿ†• New:

    "peerDependencies": {
      "hemera-joi": "^1.0.4",
      "nats-hemera": "1.x || 2.x"
    }