Adium

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16552 closed defect (fixed)

Jabber connections constantly dis-/reconnect on Retina Macbooks due to avatar sizes

Reported by: Sonix Owned by:
Milestone: Adium 1.5.10 Component: Service/XMPP (Jabber)
Version: 1.5.9 Severity: regression
Keywords: Cc: robotive
Patch Status: Accepted

Description

Summary

After switching from an old macbook to a new one with retina display and using the exact same settings, accounts and pictures I was not able to maintain a connection to both of the jabber services I use (one private server and jabber.ccc.de). After looking at the debug log and googling I determined the size of the avatar picture was the cause. As I have used the same picture on the old macbook where everything worked fine there seems to be an issue with correctly resizing the picture to fit with the size constraints of the jabber servers.

Steps to reproduce

Detail the exact steps taken to produce the bug. Use the following format, each line with " 1." before it:

  1. Connect to a Jabber account on either jabber.ccc.de or another server using ejabberd
  2. On a system with a retina display (HiDPI mode), set a sufficiently large avatar (mine was around 320x300px)
  1. observe constant reconnects

Expected results

Should set the new avatar and stay connected. If not possible automatically resize the picture so it fits.

Actual results

Disconnection from the server due to "policy violation" with instant reconnect-attempts by adium/libpurple

Regression

Tested: Adium 1.5.8 (stable) and 1.5.9b3 on OS X 10.9

Notes

Note: If this isn't an issue with HiDPI, then maybe adium should give warnings about why the connection failed and how to (propably) resolve it (i.e. change avatar size)

Copied from Adium Debug Log:

17:52:02: (Libpurple: jabber) Sending (ssl) (jloepelmann@jabber.ccc.de/Johanness-MacBook-Pro): <iq type='get' id='purple65359b31'><ping xmlns='urn:xmpp:ping'/></iq>
17:52:05: (Libpurple: jabber) Recv (ssl)(182): <stream:error><policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>XML stanza is too big</text></stream:error>
17:52:05: (Libpurple: connection) Connection error on 0x10d12c710 (reason: 0 description: Richtlinien-Verletzung)
17:52:05: Connection Disconnected: gc=d12c710 (Richtlinien-Verletzung)
17:52:05: <ESPurpleJabberAccount:378b8f0 3>:jloepelmann@jabber.ccc.de accountConnectionReportDisconnect: Richtlinien-Verletzung
17:52:05: (Libpurple: jabber) Recv (ssl)(16): </stream:stream>
17:52:05: (Libpurple: account) Disconnecting account jloepelmann@jabber.ccc.de/Johanness-MacBook-Pro (0x1037cd660)
17:52:05: (Libpurple: connection) Disconnecting connection 0x10d12c710
17:52:05: (Libpurple: connection) Deactivating keepalive.
17:52:05: (Libpurple: jabber) Sending (ssl) (jloepelmann@jabber.ccc.de/Johanness-MacBook-Pro): </stream:stream>
17:52:05: Disconnected: gc=d12c710
17:52:05: <ESPurpleJabberAccount:378b8f0 3>:jloepelmann@jabber.ccc.de: Telling the core we disconnected
17:52:05: -[AIContactObserverManager endListObjectNotificationsDelaysImmediately]:144: 
17:52:05: <ESPurpleJabberAccount:378b8f0 3>:jloepelmann@jabber.ccc.de: Disconnected ("Richtlinien-Verletzung"): Automatically reconnecting in 5.000000 seconds (0 attempts performed)
17:52:05: (Libpurple: connection) Destroying connection 0x10d12c710
17:52:06: -[AIProxyListObject dealloc]:107: <AIProxyListObject 0x10dc9a6b0 -> (null)>
17:52:10: <ESPurpleJabberAccount:378b8f0 3>:jloepelmann@jabber.ccc.de: Original image of size 260.000000 260.000000
17:52:10: <ESPurpleJabberAccount:378b8f0 3>:jloepelmann@jabber.ccc.de: Scaled image to size {96, 96}
17:52:10: -[CBPurpleAccount setAccountUserImage:withData:]:2717: <ESPurpleJabberAccount:378b8f0 3>:jloepelmann@jabber.ccc.de: Setting icon data of length 86283
17:52:10: <ESPurpleJabberAccount:378b8f0 3>:jloepelmann@jabber.ccc.de: Updating status for key: User Icon


Attachments (1)

detect-hidpi-secondary.diff (2.0 KB) - added by Sonix 3 years ago.
Patch to fix this issue.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 3 years ago by sphynx

  • Resolution set to duplicate
  • Status changed from new to closed

Closed as duplicate of #16386.

comment:2 Changed 3 years ago by Robby

  • Cc robotive added
  • Resolution duplicate deleted
  • Severity changed from normal to regression
  • Status changed from closed to new
  • Version changed from 1.5.8 to 1.5.9

It seems to me this ticket has the best description yet of this issue so I'll forward-duplicate others to it.

comment:3 Changed 3 years ago by Robby

Ticket #16386 has been marked as a duplicate of this ticket.

comment:4 Changed 3 years ago by Sonix

In relation to Ticket #16386 I might add:
I am also using a secondary display which is set as the primary display. As noted in Ticket #16063 which links to the diff which should fix the issue I found this particular line of code which might be the problem: https://hg.adium.im/adium/rev/9732ef5275e8#l2.23

The code checks only the [NSScreen mainScreen] and not other possible screens, so it *might* be that OS X internally still uses HiDPI and Adium fails to detect due to only checking one screen.

A possible fix then would be to iterate over all screens and check if any of them is using HiDPI and then using that scaling Factor.

comment:5 Changed 3 years ago by Robby

Good job! It sounds like you're on the right track. Are you in for a patch? :-)

comment:6 Changed 3 years ago by Sonix

Sure, I will look into it in the next few days :)

comment:7 Changed 3 years ago by Robby

Yay!

Changed 3 years ago by Sonix

Patch to fix this issue.

comment:8 Changed 3 years ago by sphynx

  • Milestone set to Adium 1.5.10
  • Patch Status set to Accepted
  • Resolution set to fixed
  • Status changed from new to closed

Committed in a0b7e4250562 (with some minor changes by me to match the style). Thanks for the patch!

comment:9 Changed 3 years ago by Robby

Wow, that's a quick turnaround. Thanks to everyone involved! :-)

comment:10 Changed 3 years ago by j.koopmann

Ticket #16575 has been marked as a duplicate of this ticket.

Note: See TracTickets for help on using tickets.