instedd / verboice

Open source toolkit for voice services; with special focus to the needs of medium- and low-income countries, scalable services, and interacting with vulnerable populations
http://verboice.instedd.org/
GNU General Public License v3.0
44 stars 18 forks source link

Only save session vars to `call_logs` #931

Closed ysbaddaden closed 1 year ago

ysbaddaden commented 1 year ago

Changes the call_logs.js_context column to a BLOB instead of TEXT, and leverages term_to_binary/1 and binary_to_term/1 to serialize the Erlang terms to binary and back.

Note: I assume that the commit was never actually released to production, as we can't save anything. I'm still cleaning up the column to NULL, not that it would break the text to binary migration but to make sure the Broker won't receive invalid data.

The call log no longer saves the js context but only the session vars, and only when needed to (otherwise it's an empty proplist). The session vars are serialized to YAML so we can process them in Ruby as well as Erlang.

The active GC now reconstructs the callback url from the project associated to the call log, and authenticates the callback (this was previously overlooked).

The js_context and callback_url columns have been dropped from the call_logs table as we don't need them anymore.

fixes #921 fixes https://github.com/instedd/surveda/issues/2220

ysbaddaden commented 1 year ago

Hum, I can do much better here:

ysbaddaden commented 1 year ago

Done. Now, let's test it.

leandroradusky commented 1 year ago

Except for the comment that I've left, and as far as I can review this, looks good to me :)