This PR changes the use of the Firebase v1 API to truncate the content fields within data to a maximum length.
NOTE: The existing code for the legacy API does not effectively truncate content since it relies on len(data[attr]) > MAX_BYTES_PER_FIELD which will return the number of keys inside the content dict. Since the legacy API is being removed tomorrow, I don't want to spend time coming up with a solution for this. At first glance it appears to be more involved than I would like to accurately count the size in bytes of the contents of the values inside of a python dict.
This PR changes the use of the Firebase v1 API to truncate the
content
fields withindata
to a maximum length.NOTE: The existing code for the legacy API does not effectively truncate
content
since it relies onlen(data[attr]) > MAX_BYTES_PER_FIELD
which will return the number of keys inside thecontent
dict. Since the legacy API is being removed tomorrow, I don't want to spend time coming up with a solution for this. At first glance it appears to be more involved than I would like to accurately count the size in bytes of the contents of the values inside of a python dict.