Skip to content
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

feat: Add community metadata validation #2073

Merged
merged 22 commits into from
Dec 8, 2023
Merged

Conversation

leblowl
Copy link
Collaborator

@leblowl leblowl commented Nov 15, 2023

Pull Request Checklist

  • I have linked this PR to related GitHub issue.
  • I have updated the CHANGELOG.md file with relevant changes (the file is located at the root of monorepo).

(Optional) Mobile checklist

Please ensure you completed the following checks if you did any changes to the mobile package:

  • I have run e2e tests for mobile
  • I have updated base screenshots for visual regression tests

@leblowl leblowl marked this pull request as draft November 15, 2023 14:44
@leblowl leblowl force-pushed the community-metadata-validation branch 2 times, most recently from 01ce34e to d2ec0fe Compare November 16, 2023 21:53
@leblowl leblowl changed the title DRAFT: Community Metadata Validation feat: Add community metadata validation Nov 24, 2023
@leblowl leblowl marked this pull request as ready for review November 24, 2023 23:10
@leblowl
Copy link
Collaborator Author

leblowl commented Nov 24, 2023

I'm still adding some tests, but I think this is ready for another look. Thanks!

@leblowl leblowl requested review from EmiM and siepra November 24, 2023 23:11
@leblowl leblowl force-pushed the community-metadata-validation branch 2 times, most recently from c19e016 to 10f9bc8 Compare November 28, 2023 22:41
Validate that the community metadata is only written to by the owner
and refactor it into it's own store class.
@leblowl leblowl force-pushed the community-metadata-validation branch from 10f9bc8 to d1291fa Compare November 29, 2023 16:12
@Kacper-RF
Copy link
Contributor

Please merge newest develop in Your branch and resolve conflicts in state manager.
Also there is problem in e2e invitation link test.

Copy link
Contributor

@siepra siepra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd gone through all the changes and paid extra attention to the parts I'm confident with, although the size of this PR makes it hard to be fully accurate so there's a great chance I missed something. I think I'd be best if you also get approval from someone else.

I see there're still some conflicts and failing e2e tests but overall it looks fine.

packages/backend/src/nest/storage/storage.service.ts Outdated Show resolved Hide resolved
packages/common/src/tests.ts Outdated Show resolved Hide resolved
store.dispatch(
communitiesActions.updateCommunityData({
id: community.id,
// null/undefined type mismatch here. Might make things easier
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's impossible as a factory for mocking data accepts certificate as null/undefined on purpose to perform some more advanced combinations, eg. mocking it automatically or storing and invalid redux entry basing on it's value. I think the best way is to just use // @ts-expect-error knowing it's just a matter of mocking test data

@leblowl
Copy link
Collaborator Author

leblowl commented Dec 5, 2023

@EmiM Do you think the e2e tests are failing because of changes in this PR? It also looks like a backend with tor test is failing.

@EmiM
Copy link
Contributor

EmiM commented Dec 6, 2023

@EmiM Do you think the e2e tests are failing because of changes in this PR? It also looks like a backend with tor test is failing.

Yes but because of not compatible arguments after adding orbitdb key. Look at 'Guest clicks invitation link with invalid invitation code'. This test is skipped anyway so you can either add lacking argument or remove both 'Guest clicks invitation link with invalid invitation code' and 'Guest sees modal with warning about invalid code, closes it'

Do backend tor tests pass on your local machine? If not then it may be because of this PRs changes.

Copy link
Contributor

@EmiM EmiM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be merged when e2e tests will pass

@leblowl
Copy link
Collaborator Author

leblowl commented Dec 6, 2023

@EmiM Do you think the e2e tests are failing because of changes in this PR? It also looks like a backend with tor test is failing.

Yes but because of not compatible arguments after adding orbitdb key. Look at 'Guest clicks invitation link with invalid invitation code'. This test is skipped anyway so you can either add lacking argument or remove both 'Guest clicks invitation link with invalid invitation code' and 'Guest sees modal with warning about invalid code, closes it'

Do backend tor tests pass on your local machine? If not then it may be because of this PRs changes.

When I run the tor tests locally, I get the following error:

@quiet/backend:   ● Connections manager › dials many peers on start
@quiet/backend:     thrown: "Exceeded timeout of 100000 ms for a hookfalse.
@quiet/backend:     Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

@leblowl
Copy link
Collaborator Author

leblowl commented Dec 6, 2023

Apparently, I am having trouble running Tor via those tests:

symbol lookup error: undefined symbol: evutil_secure_rng_add_bytes

@EmiM EmiM merged commit 5780574 into develop Dec 8, 2023
27 of 29 checks passed
@siepra siepra deleted the community-metadata-validation branch December 8, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants