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

args-out-of-range error when reading timestamps on Jabber messages #25

Open
parhamdoustdar opened this issue Jul 5, 2018 · 3 comments · May be fixed by #32
Open

args-out-of-range error when reading timestamps on Jabber messages #25

parhamdoustdar opened this issue Jul 5, 2018 · 3 comments · May be fixed by #32

Comments

@parhamdoustdar
Copy link

when I look in the fsm-debug buffer, I see errors like this:

Thu Jul  5 14:39:40 2018: Error (args-out-of-range "54Z" 4 6) while processing (message ((from . "some-channel/Dead Parrot") (id . "SudSN-250898") (notify . "1") (to . "parham.doustdar@XXX.com/d33849931a3de90d1e43545a5fba396051b58454") (type . "groupchat") (xml:lang . "en")) (body nil "⛔🔁 [Alert still_alerting")]

I'm using the latest version of jabber.el, and Emacs 26.1 on the Mac.

Thanks!

@parhamdoustdar
Copy link
Author

I hunted this down to jabber-util.el, line 498, where jabber-parse-time is trying to parse timezones.

It looks like jabber.el expects the indexes 23 to 27 to be timezone information, but it's not true.

What I'm seeing here looks like the fraction is from index 20 to 25 (and not 20 to 22), and index 26 is just Z, and this is throwing the timezone calculation off.

Do you know why the Jabber server could be providing timestamps like this, with no timezone information, and with longer fractions than jabber.el expects?

@Flowdalic
Copy link
Contributor

Did you had a look at https://xmpp.org/extensions/xep-0082.html (if it applies) to determine if it's a valid format?

@parhamdoustdar
Copy link
Author

Excellent, thanks for the link. Now I know where to look for standards like this!

Yes. It appears that fractions can be any number of digits:

sss: fractional second addendum to Time (MAY contain any number of digits)

It's weird. I can see how having sss as the fraction identifier can lead one to think that it has to be 3 digits.

The way I understand this is that fractions of a second are any character between the . and either a +, - or Z. In other words, as long as you are reading a digit, it's a fraction, and it's done only when a +, - or Z are reached.

If you reach Z, great, the timezone is UTC. If you don't, now you have to parse the timezone from the index of the + or - the way it's being parsed now.

tarsius pushed a commit to emacsmirror/jabber that referenced this issue Jul 29, 2023
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 a pull request may close this issue.

2 participants