fix: call authorization_error! on IMAP auth failures (#13560) (revert) (#13671)

This reverts commit 7acd239c70 to further
debug upstream issues.
This commit is contained in:
Sojan Jose
2026-02-26 18:45:18 -08:00
committed by GitHub
parent bdcc62f1b0
commit d84ae196d5
13 changed files with 14 additions and 218 deletions

View File

@@ -1,43 +0,0 @@
require 'rails_helper'
shared_examples_for 'backoffable' do
let(:obj) { FactoryBot.create(described_class.to_s.underscore.tr('/', '_').to_sym) }
before do
allow(GlobalConfigService).to receive(:load).with('BACKOFF_MAX_INTERVAL_MINUTES', 5).and_return(2)
allow(GlobalConfigService).to receive(:load).with('BACKOFF_MAX_INTERVAL_COUNT', 10).and_return(3)
# max_interval=2, max_retries=(2-1)+3=4; exhausts on 5th apply_backoff!
end
it 'starts with no backoff' do
expect(obj.in_backoff?).to be false
expect(obj.backoff_retry_count).to eq 0
end
it 'ramps backoff on each failure' do
obj.apply_backoff!
expect(obj.backoff_retry_count).to eq 1
expect(obj.in_backoff?).to be true
end
it 'caps wait time at max interval' do
4.times { obj.apply_backoff! }
expect(obj.backoff_retry_count).to eq 4
expect(obj.in_backoff?).to be true
end
it 'exhausts backoff and calls prompt_reauthorization! after max retries' do
allow(obj).to receive(:prompt_reauthorization!)
5.times { obj.apply_backoff! }
expect(obj).to have_received(:prompt_reauthorization!)
expect(obj.backoff_retry_count).to eq 0
expect(obj.in_backoff?).to be false
end
it 'clear_backoff! resets retry count and backoff window' do
obj.apply_backoff!
obj.clear_backoff!
expect(obj.in_backoff?).to be false
expect(obj.backoff_retry_count).to eq 0
end
end