Smack omemo 4.2.1-beta2-SNAPSHOT enters endless loop in "Send RatchetUpdateMessage" on received message with invalid session

During aTalk source updates to work with smack 4.2.1-beta2 snapshot, when testing is conducted between the following two clients 1 & 2; at one point I try to enable Omemo encryption chat on NA36, the smack omemo enters into an endless loop trying to “Send RatchetUpdateMessage” as captured in the log below. I am not sure the invalid sessions got created because I prematurely terminated NA36 and reinstalled apk with new source compiled multiple times. Eventually I have to end SC37 and start SA35 to get omemo session working again with NA36.

  1. NA36: aTalk (leopard@atalk.org) installed on Note3; omemoDevice (leopard@atalk.org, 1011347036)

  2. SC37: conversions (swan@atalk.org) installed on S3; omemoDevice (swan@atalk.org, 816614937)

  3. SA35: aTalk (swan@atalk.org) installed on S3; omemoDevice (swan@atalk.org, 1711246335)

============== aTalk log on Send RatchetUpdateMessage ===============

07-21 12:11:26.555 I/αTalk: [43] org.jivesoftware.smackx.omemo.OmemoService.processStanza() Received message with invalid session from swan@atalk.org:816614937. Send RatchetUpdateMessage.

07-21 12:11:26.615 D/SMACK: SENT (0):

07-21 12:11:26.635 D/SMACK: RECV (0): 01creation@001500:608047:957981creation@001500:608047:957 981BbhtJfCb/H+0xTS6bOfAzx+6tvrT6B4GmZf3epT8be8h

4L71qLx6RtXtxmFe1pYDOMrZFyDd4XdHw+e K++7e/OGHs1kv/tEBQb85wMAlzEXY5Ohn4Z5PAwRt

ypsT+0Ffiw==

BRRXkCk6JCc1wQKxO8pYIfzAMytB7he0VNzF/zxODr Vh

BScm4J5Fwj8GNeyAeIUGaV9fEn3ObhKmKY+rbdr/YGIS

BXXKL5pjBCKm0Ltr6lDCBndZxF6evtZiD72ex7rZ+C45

BcQ+zZrqff/Uae5vM6zD5c7MlM9SvpKgyUyXqVLnfSJh

BcZZOBXyD0EoRfdEBw466Ge1hzbebgo2waETLknGWbh1

07-21 12:11:27.225 D/SMACK: RECV (0):

07-21 12:11:27.235 D/SMACK: SENT (0):

07-21 12:11:57.295 I/art: Thread[2,tid=17475,WaitingInMainSignalCatcherLoop,Thread*=0xafd0e400,peer=0x12c 31080,“Signal Catcher”]: reacting to signal 3

07-21 12:11:57.665 I/art: Wrote stack traces to ‘/data/anr/traces.txt’

07-21 12:11:59.285 I/αTalk: [44] org.jivesoftware.smackx.omemo.OmemoService.processStanza() Received message with invalid session from swan@atalk.org:816614937. Send RatchetUpdateMessage.

07-21 12:11:59.325 D/SMACK: SENT (0):

07-21 12:11:59.345 D/SMACK: RECV (0): 01creation@001500:608047:957981creation@001500:608047:957 981BbhtJfCb/H+0xTS6bOfAzx+6tvrT6B4GmZf3epT8be8h

4L71qLx6RtXtxmFe1pYDOMrZFyDd4XdHw+e K++7e/OGHs1kv/tEBQb85wMAlzEXY5Ohn4Z5PAwRt

ypsT+0Ffiw==

BRRXkCk6JCc1wQKxO8pYIfzAMytB7he0VNzF/zxODr Vh

BScm4J5Fwj8GNeyAeIUGaV9fEn3ObhKmKY+rbdr/YGIS

BXXKL5pjBCKm0Ltr6lDCBndZxF6evtZiD72ex7rZ+C45

BXSsGQ+Q399NAGsxT2wqfUVQX2qzverbnmaKPMZS5Bs+

BRHWBB6Z8s+7rsLiWeZbDF9LnhyIOa+U2VffZbT6b144

BS6bEB0A+BiU0T5JxwDghUf0iIT6pUytDD2M10BCdHEk

BVSBGRu20LZT9bYHV1gCdp5gdwlHYiNEEbMMy0j64h4b

<preKeyPublic preKeyId='22

07-21 12:11:59.875 D/SMACK: RECV (0):

07-21 12:11:59.885 D/SMACK: SENT (0):

Would propose to close this thread, as I do not see it happens any more since smack 4.2.1-beta2-SNAPSHOT