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

If MAM lookup code crashes, user gets an empty result set instead of an error #4191

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

arcusfelis
Copy link
Contributor

This PR addresses MIM-2101

Proposed changes include:

  • If message fails to be decoded, we return a stanza saying so.
  • Each failed message would get such a stanza.

In case there is an error when querying
Currently debugging case when one message in archive is encoded by other format (i.e. expected XML, but gets erlang term)
@mongoose-im

This comment was marked as outdated.

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0342139) 84.27% compared to head (87d01ac) 84.33%.

Files Patch % Lines
src/mam/mam_message.erl 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4191      +/-   ##
==========================================
+ Coverage   84.27%   84.33%   +0.06%     
==========================================
  Files         551      551              
  Lines       33467    33473       +6     
==========================================
+ Hits        28204    28231      +27     
+ Misses       5263     5242      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mongoose-im

This comment was marked as outdated.

Move fix into mam_message module
@arcusfelis arcusfelis force-pushed the mam-fails-to-decode-message-fix branch from f31d3ee to 87d01ac Compare December 12, 2023 23:30
@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 12, 2023

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 87d01ac
Reports root/ big
OK: 370 / Failed: 0 / User-skipped: 40 / Auto-skipped: 0


small_tests_25 / small_tests / 87d01ac
Reports root / small


small_tests_26 / small_tests / 87d01ac
Reports root / small


small_tests_26_arm64 / small_tests / 87d01ac
Reports root / small


ldap_mnesia_25 / ldap_mnesia / 87d01ac
Reports root/ big
OK: 2268 / Failed: 0 / User-skipped: 847 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 87d01ac
Reports root/ big
OK: 4239 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 87d01ac
Reports root/ big
OK: 2268 / Failed: 0 / User-skipped: 847 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 87d01ac
Reports root/ big
OK: 4239 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


internal_mnesia_26 / internal_mnesia / 87d01ac
Reports root/ big
OK: 2408 / Failed: 0 / User-skipped: 707 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 87d01ac
Reports root/ big
OK: 4283 / Failed: 0 / User-skipped: 110 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 87d01ac
Reports root/ big
OK: 4236 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 87d01ac
Reports root/ big
OK: 4628 / Failed: 0 / User-skipped: 109 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 87d01ac
Reports root/ big
OK: 4607 / Failed: 0 / User-skipped: 130 / Auto-skipped: 0


pgsql_mnesia_26 / pgsql_mnesia / 87d01ac
Reports root/ big
OK: 4628 / Failed: 0 / User-skipped: 109 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 87d01ac
Reports root/ big
OK: 4625 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0

@arcusfelis arcusfelis marked this pull request as ready for review December 13, 2023 09:32
Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -538,7 +542,8 @@ prefs_cases() ->
run_set_and_get_prefs_cases].

impl_specific() ->
[check_user_exist].
[check_user_exist,
pm_failed_to_decode_message_in_database].
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why in this group and not in some regular pm one? Just asking 🤔

Copy link
Contributor Author

@arcusfelis arcusfelis Dec 13, 2023

Choose a reason for hiding this comment

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

cannot be run in parallel. because it changes module config in the middle of the test.

@NelsonVides NelsonVides merged commit 5b8fd70 into master Dec 14, 2023
4 checks passed
@NelsonVides NelsonVides deleted the mam-fails-to-decode-message-fix branch December 14, 2023 09:42
@jacekwegr jacekwegr added this to the 6.2.1 milestone Apr 3, 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.

4 participants