couch_potato icon indicating copy to clipboard operation
couch_potato copied to clipboard

document.reload should not read from cache

Open thilo opened this issue 4 years ago • 0 comments

In order to get the latest version of a document, document.reload should not use the cache when set. e.g. this is important in cases where you want to avoid conflicts across processes.

failing test for caching_spec.rb

  it 'does not use the cache for reloads' do
    expect(couchrest_db).to receive(:get).with('1').exactly(2).times
    doc = db.load_document '1'
    doc.reload
  end

thilo avatar Jan 22 '21 20:01 thilo