Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Extension rewrite, rust cleanup, and new facebook parser #64

Merged
merged 38 commits into from
Apr 5, 2018

Conversation

thejefflarson
Copy link
Contributor

This is a very large pull request, because it contains everything from a bit of cleanup on the rust side to a large rewrite of the extension itself. It also includes jest tests for the frontend and more testing for the backend. It should solve a bunch of problems that were documented in #41

@jeremybmerrill
Copy link
Contributor

I'm digging through this now

@jeremybmerrill
Copy link
Contributor

So what's this Snap thing in the extension tests?

onClick={() => dispatch(toggle(type))}
>
{getMessage(message)}
{amount ? <b>{100 > amount ? amount : "100+"}</b> : ""}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it right that this'll never happen, since the maximum number of ads saved got lowered to 50 (for both Ratings and Ads) as an attempt at a performance fix? Should we maybe move the limit back to 100?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think so

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should probably make it 150 or something

}
}

menuFilter() {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is intended to be kinda like a Java-style interface, with child classes implementing this, but without a generic implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

StateMachine? Yep that’s just an interface so that the two machines, Parser and IdFinder, conform too

.setData(parsed)
.setMethod("GET")
.setRelativeTo(document.body)
.setNectarModuleDataSafe(document.body)
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this?

Copy link
Contributor

Choose a reason for hiding this comment

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

err, what are setNectarModuleDataSafe and setRelativeTo in particular?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are from Facebook, we call them to get some sort of token that allows us to get the targeting without popping up the huge targeting dialog

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh weird.

@thejefflarson
Copy link
Contributor Author

The snap files are part of jest:

https://facebook.github.io/jest/docs/en/snapshot-testing.html

They basically make sure there aren’t crazy markup changes

@thejefflarson
Copy link
Contributor Author

thejefflarson commented Apr 5, 2018 via email

@jeremybmerrill
Copy link
Contributor

I guess let's merge it.

I can't find that spot where it cuts the number of ads and ratings down to 50.

@thejefflarson
Copy link
Contributor Author

thejefflarson commented Apr 5, 2018 via email

@jeremybmerrill
Copy link
Contributor

Ah, cool. It's 200 in this branch (which is fine too!)... which is why I couldn't find it. I'll merge.

@jeremybmerrill jeremybmerrill merged commit 61913f8 into master Apr 5, 2018
@jeremybmerrill jeremybmerrill deleted the rust-cleanup branch June 5, 2018 14:09
imalsogreg pushed a commit to imalsogreg/facebook-political-ads that referenced this pull request Jul 1, 2018
Extension rewrite, rust cleanup, and new facebook parser
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants