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

[FIX] website: fix authentication of archived visitor #41220

Conversation

dbeguin
Copy link
Contributor

@dbeguin dbeguin commented Dec 3, 2019

If a visitor logs in (and has a visitor_id in his cookie), the partner will be
linked to the visitor. If, after 1 week, the visitor tries to connect again
with a different session (or another visitor_id in cookies), the authenticate
will crash because

  • _cron_archive_visitors applies on visitor inactive since at least a week
  • there can be only one visitor per partner (sql constraint)
  • the visitor linked to the partner is not retrieved (because archived) and
    we try to link the partner to a new visitor.

Further than that, if the visitor is archived and the linked partner wants to
login again with a new visitor_id, we should

  • reactivate the previous visitor,
  • copy history from newest to previous one,
  • delete the newest one

Note that last two points were already done before this commit.

Task ID: 2120464
PR #40199
Fixes #40077
Fixes #40301

If a visitor logs in (and has a visitor_id in his cookie), the partner will be
linked to the visitor. If, after 1 week, the visitor tries to connect again
with a different session (or another visitor_id in cookies), the authenticate
will crash because

  * _cron_archive_visitors applies on visitor inactive since at least a week
  * there can be only one visitor per partner (sql constraint)
  * the visitor linked to the partner is not retrieved (because archived) and
  we try to link the partner to a new visitor.

Further than that, if the visitor is archived and the linked partner wants to
login again with a new visitor_id, we should

  * reactivate the previous visitor,
  * copy history from newest to previous one,
  * delete the newest one

Note that last two points were already done before this commit.

Task ID: 2120464
PR odoo#40199
Fixes odoo#40077
Fixes odoo#40301

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@dbeguin
Copy link
Contributor Author

dbeguin commented Dec 3, 2019

@d-fence : Ping ! Can you r+ this one and ignore the #41203
(because I don't have the rights)
Bisous!

@C3POdoo C3POdoo added the RD research & development, internal work label Dec 3, 2019
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Dec 3, 2019
@tde-banana-odoo
Copy link
Contributor

@robodoo r+

@robodoo robodoo added merging 👷 and removed CI 🤖 Robodoo has seen passing statuses merging 👷 labels Dec 3, 2019
@robodoo
Copy link
Contributor

robodoo commented Dec 3, 2019

Staging failed: ci/runbot on adc94fda01c344d60c490015e59de85dac0240e5 (view more at http://runbot.odoo.com/runbot/build/715535)

@tde-banana-odoo
Copy link
Contributor

@robodoo retry

@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses r+ 👌 and removed error 🙅 labels Dec 3, 2019
robodoo pushed a commit that referenced this pull request Dec 3, 2019
If a visitor logs in (and has a visitor_id in his cookie), the partner will be
linked to the visitor. If, after 1 week, the visitor tries to connect again
with a different session (or another visitor_id in cookies), the authenticate
will crash because

  * _cron_archive_visitors applies on visitor inactive since at least a week
  * there can be only one visitor per partner (sql constraint)
  * the visitor linked to the partner is not retrieved (because archived) and
  we try to link the partner to a new visitor.

Further than that, if the visitor is archived and the linked partner wants to
login again with a new visitor_id, we should

  * reactivate the previous visitor,
  * copy history from newest to previous one,
  * delete the newest one

Note that last two points were already done before this commit.

Task ID: 2120464
PR #40199
Fixes #40077
Fixes #40301

closes #41220

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@robodoo robodoo closed this Dec 3, 2019
@robodoo robodoo temporarily deployed to merge December 3, 2019 14:27 Inactive
@fw-bot fw-bot deleted the saas-13.1-fix-visitor-authenticate-and-archiving-dbe branch December 17, 2019 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants