Skip to content
This repository has been archived by the owner. It is now read-only.

Auto-include propagates correctly #7680

Merged
merged 2 commits into from Mar 20, 2017

Conversation

@NejcZdovc
Copy link
Member

NejcZdovc commented Mar 13, 2017

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Resolves #7451

Auditors

@mrose17

Test Plan

  • Enable payments in settings
  • Disable auto-include switch
  • Visit brianbondy.com in a new tab, site is added in the list and is not included

Automated test plan

  • npm run test -- --grep="auto include"
@bsclifton
Copy link
Member

bsclifton commented Mar 13, 2017

Added @cezaraugusto; during our face to face, this was one that he and @mrose17 were talking about. I believe Cezar had started looking into this

Copy link
Member

mrose17 left a comment

LGTM!

@bsclifton
Copy link
Member

bsclifton commented Mar 13, 2017

Per discussion in #7451, we need to set the include flag (since it currently changes include status for items when you toggle auto include on/off- this is very confusing for the user)

@NejcZdovc NejcZdovc force-pushed the NejcZdovc:hotfix/#7451-autoinclude branch 2 times, most recently from fa56568 to c4094cd Mar 14, 2017
@NejcZdovc
Copy link
Member Author

NejcZdovc commented Mar 14, 2017

Ok so now I did two things

  1. when publisher is added we set it false if auto include is off c4094cd#diff-9b959b675446ba95e1abe0b81e0f7a9bR599
  2. I updated clean up functionality, which would go through the undefined auto include property of the publisher and set it to true (we used true as a default fallback in the UI till now) c4094cd#diff-9b959b675446ba95e1abe0b81e0f7a9bR990

This PR is ready for a second review

Copy link
Member

mrose17 left a comment

LGTM!

result = synopsis.publishers[publisher].options.stickyP
} else {
result = true
}
appActions.changeSiteSetting(pattern, 'ledgerPayments', result)
}
delete synopsis.publishers[publisher].options.stickyP

This comment has been minimized.

Copy link
@cezaraugusto

cezaraugusto Mar 15, 2017

Contributor

I think you need a check here as well. With those changes synopsis.publishers[publisher] is still undefined at this point. App is crashing for me and pointing on that line.

Worth note: if you have a site in publisher list error doesn't happen. For publishers on exclusion list (such as Youtube), crash is intermittent. Other publishers instantly crash app.

STR: With a fresh profile (no synopsis, no session, no ledger-state), enable Payments and visit a publisher site (i.e. https://clifton.io)

This comment has been minimized.

Copy link
@NejcZdovc

NejcZdovc Mar 15, 2017

Author Member

Ok, but why would be failing now. It was outside the if statement before this PR. It was strange for me when I was doing this change, but I left it there because it was there before. Will move it inside the if

This comment has been minimized.

Copy link
@cezaraugusto

cezaraugusto Mar 15, 2017

Contributor

nice, let's cc @mrose17 for thoughts

This comment has been minimized.

Copy link
@NejcZdovc

NejcZdovc Mar 16, 2017

Author Member

@cezaraugusto can you please try again. I rebase it on the master and now I don't have any crashes.

This comment has been minimized.

Copy link
@cezaraugusto

cezaraugusto Mar 16, 2017

Contributor

thanks, no crashes this time. However I followed STR and publisher is still auto-including for me as soon as it populates payments panel.

I did a look inside publisherToggle (only part besides payments that changes publisher state) but state is only changed there if you hit urlbar icon, so it must come from ledger itself.

IMO you might want something similar to this:
https://github.com/brave/browser-laptop/pull/7289/files#diff-9b959b675446ba95e1abe0b81e0f7a9bL566

This comment has been minimized.

Copy link
@NejcZdovc

NejcZdovc Mar 16, 2017

Author Member

It's working for me. Do you have auto include set to off in payments?

This comment has been minimized.

Copy link
@cezaraugusto

cezaraugusto Mar 16, 2017

Contributor

yep, I removed last comment with wrong video showing STR. After your update it's working fine.

What I saw is that, if you have a clear session with a synopsis file, publishers you had previously are affected by changing auto-suggest, which should only be applied for new publishers. Note that without clearing session-store it works perfectly:

STR:

  1. remove session-store file
  2. keep ledger-synopsis.json (supposing it has publishers)

gif_auto_include_old_synopsis

I suppose auto-include should only apply for new publishers and not for existing ones? If I'm wrong then PR is good to go ;)

This comment has been minimized.

Copy link
@NejcZdovc

NejcZdovc Mar 16, 2017

Author Member

No this is something that needs to be fixed. I have implemented this, but it was causing a crash for some X reason (you noticed this in your first comment). So I removed it for now and will try to find another solution today

This comment has been minimized.

Copy link
@NejcZdovc

NejcZdovc Mar 18, 2017

Author Member

@cezaraugusto I changed the logic now, can you please try it again

@NejcZdovc NejcZdovc force-pushed the NejcZdovc:hotfix/#7451-autoinclude branch 7 times, most recently from f7fc142 to a9e6e4d Mar 16, 2017
@NejcZdovc
Copy link
Member Author

NejcZdovc commented Mar 18, 2017

@bsclifton PR is ready now for a review

@NejcZdovc NejcZdovc force-pushed the NejcZdovc:hotfix/#7451-autoinclude branch 4 times, most recently from 2607ca4 to d6c1bce Mar 19, 2017
NejcZdovc and others added 2 commits Mar 13, 2017
Resolves #7451

Auditors: @mrose17

Test Plan:
- Enable payments in settings
- Disable auto-include switch
- Visit brianbondy.com in a new tab, site is added in the list and is not included

Includes webdriver tests
…s-ci with #7773 and this broke the `uitest` task. Since the unit tests run quickly and `npm run unittest` still works great, this task isn't really needed anymore.

Auditors: @NejcZdovc, @diracdeltas
Copy link
Member

bsclifton left a comment

Manually tested and also ran automated tests. Everything works as expected- great job on this one 😄

@bsclifton bsclifton merged commit bee2993 into brave:master Mar 20, 2017
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@NejcZdovc

This comment has been minimized.

Copy link
Member

NejcZdovc commented on c8b88bb Mar 20, 2017

@bsclifton I use this command a lot in the combination with grep. Can you give an example how can I easily test ui test now? (probably run testsuite with param TEST_DIR and grep?)

This comment has been minimized.

Copy link
Member

NejcZdovc replied Mar 20, 2017

I am running test now like this npm run test -- --grep="Ledger table" after this change

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.