Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Hive not responding #328

Closed
KBenavidez opened this issue Mar 8, 2014 · 7 comments
Closed

Hive not responding #328

KBenavidez opened this issue Mar 8, 2014 · 7 comments
Assignees

Comments

@KBenavidez
Copy link

Hive starts to not respond after clicking the contacts and applications menu buttons.

@ghost ghost added bug labels Mar 8, 2014
@nschum
Copy link
Contributor

nschum commented Mar 9, 2014

I don't know what is going on exactly, but apparently OS X 10.7 gets stuck during layouting when resizeWithOldSuperviewSize updates the HITextField's frame. I would assume that setting the frame triggers another layout, so it never ends.

Removing resizeWithOldSuperviewSize completely solved the issue, but I don't know what else that might break.

@mackuba
Copy link
Member

mackuba commented Mar 10, 2014

I wonder why hasn't anyone with 10.7 seen this before? Does this only happen in some specific cases?...

@nschum
Copy link
Contributor

nschum commented Mar 10, 2014

Yes. It probably depends on the exact length of one of the text fields, but it looks like a bug in 10.7.

@mackuba
Copy link
Member

mackuba commented Mar 12, 2014

We've got someone on 10.8 with this :\ https://twitter.com/alanthonyc/status/443530693734170624

mackuba added a commit that referenced this issue Mar 26, 2014
there's no reason for that since it's not editable here, and HITextField
currently interacts with autolayout in a weird way on some systems;
in future when HITextField is only used in autolayout-enabled xibs, we
can simply remove the custom auto-resizing code that causes problems
@mackuba
Copy link
Member

mackuba commented Mar 26, 2014

Ok, so like @nschum wrote, the problem was about HITextField interacting in a weird way with autolayout. Since it was written before we started using autolayout and it's still used in some views without autolayout, it has some internal auto-resizing code, which somehow gets in conflict with autolayout on some systems, even though it works on mine.

Basically what happens is:

  • autolayout changes text field to have width e.g. 194 px
  • the text field's layout code is triggered when its parent resizes, and it tries to keep a width of MIN(preferredWidth, parentWidth), but somehow it calculates it as 193 px and resizes to that width
  • autolayout recalculation is triggered which resizes it back to 194 px
  • etc.

So the possible solutions are:

  • make sure HITextField is only used in autolayout xibs and remove the custom code
  • make sure HITextField is only used in non-autolayout xibs
  • make it support both cases

Since it was only used in HIContactInfoViewController (w/ AL) and HINewContactViewController (w/o AL), and the first one didn't really have to be an HITextField at all, I chose the simplest (second) solution. When HINewContactViewController is converted to AL we should be able to remove resizeWithOldSuperviewSize and most of recalcForString and probably provide that as an override of intrinsicContentSize or something like that.

@mackuba
Copy link
Member

mackuba commented Mar 27, 2014

Looks like it's not good enough - Karla says it still crashes on the edit profile page...

@mackuba
Copy link
Member

mackuba commented Mar 31, 2014

@KBenavidez confirms it's working on the latest test build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants