fix: Avoid introducing new attributes in search (#12791)
Fix `Limit of total fields [1000] has been exceeded` https://linear.app/chatwoot/issue/CW-5861/searchkickimporterror-type-=-illegal-argument-exception-reason-=-limit#comment-6b6e41bd
This commit is contained in:
@@ -67,11 +67,11 @@ RSpec.describe Messages::SearchDataPresenter do
|
||||
end
|
||||
|
||||
it 'includes campaign_id' do
|
||||
expect(presenter.search_data[:campaign_id]).to eq('123')
|
||||
expect(presenter.search_data[:additional_attributes][:campaign_id]).to eq('123')
|
||||
end
|
||||
|
||||
it 'includes automation_rule_id' do
|
||||
expect(presenter.search_data[:automation_rule_id]).to eq('456')
|
||||
expect(presenter.search_data[:additional_attributes][:automation_rule_id]).to eq('456')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,11 +15,11 @@ RSpec.describe Widget::TokenService, type: :service do
|
||||
end
|
||||
|
||||
it 'uses the configured value for token expiry' do
|
||||
freeze_time do
|
||||
travel_to '2025-01-01' do
|
||||
token = service.generate_token
|
||||
decoded = JWT.decode(token, Rails.application.secret_key_base, true, algorithm: 'HS256').first
|
||||
expect(decoded['iat']).to eq(Time.now.to_i)
|
||||
expect(decoded['exp']).to eq(30.days.from_now.to_i)
|
||||
expect(decoded['iat']).to eq(Time.zone.now.to_i)
|
||||
expect(decoded['exp']).to eq(Time.zone.now.to_i + 30.days.to_i)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -30,11 +30,11 @@ RSpec.describe Widget::TokenService, type: :service do
|
||||
end
|
||||
|
||||
it 'uses the default expiry' do
|
||||
freeze_time do
|
||||
travel_to '2025-01-01' do
|
||||
token = service.generate_token
|
||||
decoded = JWT.decode(token, Rails.application.secret_key_base, true, algorithm: 'HS256').first
|
||||
expect(decoded['iat']).to eq(Time.now.to_i)
|
||||
expect(decoded['exp']).to eq(180.days.from_now.to_i)
|
||||
expect(decoded['iat']).to eq(Time.zone.now.to_i)
|
||||
expect(decoded['exp']).to eq(Time.zone.now.to_i + 180.days.to_i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user