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

try to fix two UI tests #15755

Merged
merged 19 commits into from Apr 19, 2020
Merged

try to fix two UI tests #15755

merged 19 commits into from Apr 19, 2020

Conversation

diosmosis
Copy link
Member

@diosmosis diosmosis commented Mar 31, 2020

Changes:

  • login to matomo after oneclickupdate is done (this is required now I believe due to the app specific token auth change. might not be an issue after 4.x...)
  • fixes for a couple UI tests

@diosmosis diosmosis added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Mar 31, 2020
@diosmosis diosmosis added this to the 4.0.0 milestone Mar 31, 2020
@diosmosis diosmosis changed the title try to fix two UI tests try to fix two UI tests + oneclickupdate bugs Mar 31, 2020
@diosmosis diosmosis changed the title try to fix two UI tests + oneclickupdate bugs try to fix two UI tests + run oneclickupdate in two requests Apr 1, 2020
@diosmosis diosmosis added Needs Review PRs that need a code review and removed not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Apr 1, 2020
@diosmosis
Copy link
Member Author

Note: the one click update changes should be merged into 3.13.5 to make sure as many people as possible have an error free one click update to matomo 4. Though we'll have to try it before it's released...

@sgiehl
Copy link
Member

sgiehl commented Apr 7, 2020

@diosmosis the changes for updater are exactly the same as in the PR for 3.x-dev, right?
Might make sense to remove them from this PR then as they will be merged over from 3.x-dev to 4.x-dev anyways. (Might avoid some merge conflicts though)

@diosmosis diosmosis changed the title try to fix two UI tests + run oneclickupdate in two requests try to fix two UI tests Apr 8, 2020

await page.type('#login_form_login', 'superUserLogin');
await page.type('#login_form_password', 'superUserPass');
await page.click('#login_form_submit');
Copy link
Member

Choose a reason for hiding this comment

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

So automatic login after update won't work anymore? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

What automatic login are referring to? From my understanding the session is just sent again after the update, but I think it's when updating to 4.x due the app specific token auth change it requires a new login. Otherwise anyone would get logged in even if they aren't authorized to?

Copy link
Member

Choose a reason for hiding this comment

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

That's what I meant. Guess it's not worth to have a closer look if it's possible to not require a new login...

Copy link
Member Author

Choose a reason for hiding this comment

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

@tsteur might know if the session should still work

Copy link
Member

Choose a reason for hiding this comment

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

if it's ok that the session gets terminated, the changes would be good to merge

Copy link
Member

Choose a reason for hiding this comment

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

but I think it's when updating to 4.x due the app specific token auth change it requires a new login. Otherwise anyone would get logged in even if they aren't authorized to?

Not sure I fully understand the problem @sgiehl @diosmosis

Is this something that happens for the actual user or is more of a problem only for tests? Generally, when updating, the current token_auth should be automatically be migrated to an app specific token and still work. I suppose the token_auth is not really used for the session though.

What does change is indeed the session cookie maybe as we're removing login and token hash or so from the cookie AFAIK. Not sure if this causes the issue?

If user gets logged out would this cause an issue for https://github.com/matomo-org/matomo/pull/15770/files#diff-adf51e994c74a650d8afec954288d4c3R178 where we require user to be logged in? Not sure if user can be logged out in between (either by this session change or because the cookie expire time which might expire after 30 minutes just in between steps).

Looking at the original PR for app specific tokens, I can only imagine that maybe this session value is missing and causing an issue (random guess) https://github.com/matomo-org/matomo/pull/15410/files#diff-6c322e8c4c05670597358309f152c51aR94

Generally I would say it's fine though if a user gets logged out during the update I would say. As long as it's possible to complete the update fully.

Copy link
Member Author

@diosmosis diosmosis Apr 14, 2020

Choose a reason for hiding this comment

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

If user gets logged out would this cause an issue for https://github.com/matomo-org/matomo/pull/15770/files#diff-adf51e994c74a650d8afec954288d4c3R178 where we require user to be logged in?

It might be... though we only make the request internally in Matomo, so maybe we can create a temporary token auth for that request to make sure it works?

Copy link
Member

Choose a reason for hiding this comment

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

That could work @diosmosis

Copy link
Member Author

Choose a reason for hiding this comment

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

@tsteur made the change after merging in changes from 3.x, can review it again

Copy link
Member

Choose a reason for hiding this comment

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

👍

@sgiehl sgiehl requested a review from tsteur April 14, 2020 08:05
@sgiehl sgiehl linked an issue Apr 14, 2020 that may be closed by this pull request
@diosmosis diosmosis merged commit 4469a9a into 4.x-dev Apr 19, 2020
@diosmosis diosmosis deleted the fix-build branch April 19, 2020 23:20
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix automatic login after one click update
4 participants