You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The synth_overage tries to do .utilization >= 100 on usage. Since usage can of of type UsageResponse which doesn't have utilization. It throws an Exception.
Possible Fix -
def synth_overage?
self.class.synth_provider&.usage&.utilization.to_i >= 100
end
and displaying a flash that key is invalid or similar.
The text was updated successfully, but these errors were encountered:
@nikhilbadyal thanks for the report. I think your proposed solution makes sense!
In the Synth settings view, we can also leverage synth_provider.healthy? to check whether the provider has a valid API key. This will return true regardless of whether the provider has an overage, so is a good use case for this.
Describe the bug
>=
check on a nil object.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Application should not crash.
What version of Maybe are you using?
"Self-hosted". Latest Commit
Screenshots / Recordings
Additional context
Currently the API Synth Settings screen doesn't force user to enter valid key or prevent itself from saving invalid key into DB.
If someone miss types a invalid API key or If somehow key becomes invalid like the key was revoked.
The usage method will return a UsageResponse object on 401.
The synth_overage tries to do
.utilization >= 100
on usage. Since usage can of of typeUsageResponse
which doesn't have utilization. It throws an Exception.Possible Fix -
and displaying a flash that key is invalid or similar.
The text was updated successfully, but these errors were encountered: