mafintosh / hyperdb

Distributed scalable database
MIT License
753 stars 75 forks source link

hyperdb#put callback never called WITH THIS ONE WEIRD TRICK #87

Closed hackergrrl closed 6 years ago

hackergrrl commented 6 years ago
var tape = require('tape')
var create = require('./helpers/create')
var replicate = require('./helpers/replicate')

tape('unauthorized writer doing a put after replication', function (t) {
  t.plan(1)
  var a = create.one()
  a.ready(function () {
    var b = create.one(a.key)
    b.ready(function () {
      replicate(a, b, function () {
        b.put('foo', 'bar', function (err) {
          t.error(err)
        })
      })
    })
  })
})

The replicate step seems necessary. b isn't authorized here.

hackergrrl commented 6 years ago

excellent! :tada: