Flatten threads: fix for application/json+protobuf responses
When a new message is created in a thread, the thread itself is
reloaded, but via an application/json+protobuf request (array-like data)
instead of a regular text/plain request (object-like data). Since the
code didn't work well for these types of requests, the thread didn't
fully load.
This CL fixes this issue by correctly handling application/json+protobuf
responses in the response modifiers.
An issue with the read-only interceptors has also been fixed, and tests
have been added to ensure that the array-like to object-like and
viceversa transformation functions work properly.
Bug: twpowertools:153
Change-Id: If6cd5adc67d676bf36986f325e791124fa71da51
diff --git a/Makefile b/Makefile
index ba2ad08..bef8a1c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
-.PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_chromium_canary release_gecko_stable build_test_extension clean_releases clean trigger_nightly_build
+.PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_chromium_canary release_gecko_stable build_test_extension clean_releases test clean trigger_nightly_build
WEBPACK := ./node_modules/webpack-cli/bin/cli.js
+JEST := node --experimental-vm-modules ./node_modules/jest/bin/jest.js
RELEASE_SCRIPT := bash tools/release.bash
grpc_proto_gen:
@@ -61,6 +62,9 @@
clean_releases:
rm -rf out
+test:
+ $(JEST)
+
clean: clean_deps clean_dist clean_releases
# Manually trigger the nightly build. It also makes sure the tracked master branch is up to update