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

KAZOO-5923: Fix number(s) synchronisation #5206

Merged
merged 1 commit into from
Oct 15, 2018
Merged

Conversation

harenson
Copy link
Contributor

@harenson harenson commented Oct 8, 2018

No description provided.

Copy link
Member

@jamesaimonetti jamesaimonetti left a comment

Choose a reason for hiding this comment

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

Any chance you could create a unit test that showed the error this is fixing and shows the code working as expected with these changes?

case not ShouldEnsureDocIsInRightAccountDb
andalso UsedBy =:= kz_json:get_ne_binary_value(?PVT_USED_BY, NumDoc)
andalso have_same_pvt_values(NumDoc, Doc)
andalso NewNumDoc =:= Doc
Copy link
Member

Choose a reason for hiding this comment

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

This will compare things with respect to key ordering which means {[{a, 1}, {b, 2}]} will not be equal to {[{b,2}, {a,1}]} when these should be considered equal documents. Use kz_json:are_equal(NewNumDoc, Doc) instead.

fix_docs({error, _R}, Doc, AccountDb, _NumberDb, _DID) ->
?SUP_LOG_DEBUG("~s disappeared from ~s (~p), deleting from AccountDb", [_DID, _NumberDb]),
case kz_datamgr:del_doc(AccountDb, Doc) of
{ok, _} -> ok;
Copy link
Member

Choose a reason for hiding this comment

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

Tickie atoms plz

KAZOO-5923: use kz_json:are_equal/2 instead of the =:= operator and tickie atoms
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