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

T1732 - Fix incorrect loading of interactions for partners without email addresses #1953

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

alexis-allemann
Copy link
Contributor

Problem

When loading the interaction resume for a partner without a defined email address, the system mistakenly loads interactions for all partners who lack an email address. This behavior results in incorrect data being displayed.

Solution

To address this issue, a check is introduced to verify if the partner has an email address before attempting to load their interactions. If the partner does not have an email address, the search scope is restricted to prevent loading interactions from other partners without email addresses.

@alexis-allemann alexis-allemann self-assigned this Aug 21, 2024
@alexis-allemann
Copy link
Contributor Author

⚠️ Warning

It is necessary to execute the following SQL query on the production database after this PR has been deployed. This query will remove the excess rows in the interaction_resume table and reset the page and date indexes that have already been fetched.

begin transaction;

update res_partner rp set last_interaction_fetch_date = null, last_interaction_fetch_page = 0 where rp.id in (
	select distinct rp.id from interaction_resume ir join res_partner rp on ir.partner_id = rp.id where rp.email is null
);

delete from interaction_resume ir where ir.partner_id in (
	select distinct rp.id from interaction_resume ir join res_partner rp on ir.partner_id = rp.id where rp.email is null
);

end transaction;

@ecino ecino force-pushed the T1732-interaction_resume_bug branch from 6888f48 to c51a818 Compare August 22, 2024 05:31
@ecino ecino merged commit 5ce2f5f into 14.0 Aug 22, 2024
1 check failed
@ecino ecino deleted the T1732-interaction_resume_bug branch August 22, 2024 05:32
Copy link

sonarcloud bot commented Aug 22, 2024

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.

2 participants