-
Couldn't load subscription status.
- Fork 298
Remove Dependency on org.json:json Artifact (#113), Java 11 build problems (#243) #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @matejsp for putting this together. Code looks pretty good. I only had some minor comments. Make sure to also update the CHANGELOG file.
src/main/java/com/google/firebase/database/util/JsonMapper.java Outdated Show resolved Hide resolved
src/main/java/com/google/firebase/database/util/JsonMapper.java Outdated Show resolved Hide resolved
src/test/java/com/google/firebase/database/connection/WebsocketConnectionTest.java Outdated Show resolved Hide resolved
| @schmidt-sebastian can you also take a look from the RTDB perspective, and see if you find any problems. |
8ffd41b to b2a75de Compare | I have updated changelog, and resolved two issues that you pointed out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM for me. I will run the integration test suite soon to make sure everything's good there as well.
| @matejsp this is failing an integration test: |
| RTDB is responding differently when different json libraries are used. Existing behavior (org.json):Modified behavior (gson)Note that the result of the query is different, which causes the test failure. @rockwotj @mikelehen any ideas? |
| I'm not surprised that there are differences here. Is possible to get the objects that are being rendered differently? Also @hiranya911 which test is your comment from? |
| I'll try to find the two nodes in the console. This is the failing test: firebase-admin-java/src/test/java/com/google/firebase/database/integration/QueryTestIT.java Lines 1813 to 1829 in 6b46ded
|
| @rockwotj The 2 nodes are rendered identically in RTDB afaict. If I run the gson-based implementation against the node created by org.json, the test still fails. |
| I would then expect the difference is reading from the network? That looks consistent with the test. |
| So these are the two responses we get. Success case: Failure case: It seems RTDB returns 5 things in each case, but one of them doesn't respect the |
| @schmidt-sebastian is OOO. I'll take a look at this when I get a few spare cycles. For the test failure, can you see what the SDK is sending to the backend? If it's getting wrong query results, it's probably sending the wrong query somehow (thanks for digging in!). |
| @mikelehen the data looks the same in both cases from the client - if I knew how to run these locally I'd look at what the server is seeing (tcpdump?). |
| @rockwotj Gah, sorry. I see you guys covered that above. My bad. |
| @rockwotj you can do this to run the test locally.
EDIT: BTW you can also see the SDK outgoing messages in the debug logs I've posted above. |
| There was a problem with "null" handling. It seems that firebase code does not handle "null" values very well. I have changed Gson to emit null values (instead of skipping them as is default Gson behaviour). This test now works again. |
| Ah strange those logs must have been wrong then? Our server does explicitly expect |
| Very interesting. I think logs get generated pre-serialization. So it logs the Map in the memory as opposed to the actual outgoing json string. |
| Adding a bit of extra logging exposes the problem. Success case: Failure case: |
| @rockwotj @mikelehen I'm at an LGTM with this. Can somebody from the RTDB team take a look and approve before we merge? |
| I have left a few comments. If we resolve those, then I think I'm happy with this. |
src/main/java/com/google/firebase/database/util/JsonMapper.java Outdated Show resolved Hide resolved
src/test/java/com/google/firebase/database/util/JsonMapperTest.java Outdated Show resolved Hide resolved
| commented, fixed, rebased, squashed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from me. Will merge once that last comment on CHANGELOG is addressed.
| fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! A few more comments after taking another look (sorry).
src/main/java/com/google/firebase/database/util/JsonMapper.java Outdated Show resolved Hide resolved
src/main/java/com/google/firebase/database/util/JsonMapper.java Outdated Show resolved Hide resolved
src/main/java/com/google/firebase/database/util/JsonMapper.java Outdated Show resolved Hide resolved
src/test/java/com/google/firebase/database/connection/WebsocketConnectionTest.java Outdated Show resolved Hide resolved
52e2847 to 3050db1 Compare src/test/java/com/google/firebase/database/connection/WebsocketConnectionTest.java Outdated Show resolved Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think this looks good!
As a minor side-note, in general it's preferable not to force-push changes to a PR since:
- As a reviewer it's very nice for me to be able to see only what changed since my last review, but if you force-push commits, I can't do that and have to look at the whole diff again.
- github has trouble dealing with comments that are made on a commit that is then lost due to a force-push. So sometimes comments disappear, etc.
| (and since we always do "squash merge", it's okay to have tons of commits in a PR, so there's no need to force-push) |
fixing #113