~singpolyma/sgx-jmp

sgx-jmp/lib/trivial_backend_sgx_repo.rb -rw-r--r-- 843 bytes
Merge branch 'use-tel-we-have'

* use-tel-we-have:
  Skip asking backend about registration when we know the tel already
Skip asking backend about registration when we know the tel already

This is an optimization.  If we are looking up by tel already, then we don't
need to ask the backend sgx if they have a tel or what it is, we know that, so
just use that information directly and save us a call.
Merge branch 'voicemail-on-error'

* voicemail-on-error:
  Use default OGM when error loading customer
  On customer load error, try not loading from SGX and assuming no transcription
On customer load error, try not loading from SGX and assuming no transcription
Testing has gone well, enable RevAI for everyone

Disabling the Bandwidth transcription in the process
Optional alternate transcription with rev.ai

The bitfield bit 1 was used by a different project (sgx-catapult, see:
https://gitlab.com/ossguy/sgx-catapult/-/commit/459d7d1dfe208db1708f1d648b82b38c002ad35a).
This other project no longer uses the bit, and in fact that whole project is
dead and gone, but if you previously ran that project against the same redis
that you now run this project against then please make sure you have zeroed-out
that bit first.

You can verify using this script:

    redis = Redis.new
    redis.keys("catapult_settings_flags-*").each do |k|
      p redis.getbit(k, 1)
    end
Move CustomerFwd behind Customer

All the previously-lazy BackendSgx data is now either all loaded or all not
loaded by swapping the sgx_repo used by your CustomerRepo instance.  When not
loaded the fields are filled with bottom values that explode when used.  When
loaded the values are present in RAM and not promises at all.  Most code paths
do not need any of the data, a few need most of it, so this seems like a good
trade-off.  Most code using this object will simply never touch those fields or
care about how they are loaded, etc.

Of course, most of this data isn't even SGX related and should move out of here,
but that would take a data model refactor/migration on the catapult_* schema.