Githawk: Comment image uploading broken when already typed something

Created on 26 Nov 2017  Β·  10Comments  Β·  Source: GitHawkApp/GitHawk

To reproduce:

Start a comment
Upload an image

The image markdown is never added to your WIP comment


Bug Report Dump (Auto-generated)

Version 1.14.0 (1230)
Device: iPhone X (iOS 11.1.2)
TestFlight: true

πŸ› bug

All 10 comments

Hmm can also repro this. The delegate is hooked up, the text view exists. Something weird is going on...

Using sim and personal phone I've not been able to reproduce, to confirm the steps I'm doing is:

  • Tap "Leave a comment" (Don't change anything)
  • Tap Upload Image
  • Go through the flow
  • When I'm returned back to the text view, it inserts the text just fine

I've also tried not tapping leave a comment, and going straight to the upload image (technically this bug: #231) but that also works. I've also tried inserting a comment, and the message is inserted much like a header is πŸ€”

@Sherlouk before tapping upload, add some text. It’ll break if there is already text.

Sent with GitHawk

Alright reproduced, the textview's text is being defined correctly.

What I think is happening is the Slack TextViewController's caching mechanism is setting the textView's text to be what it cached on view[Will/Did]Appear but because we've changed the version which isn't cached it's basically just overriding with what it thinks is the correct answer

It doesn't break when you have no text as it skips all of the caching logic

Un-assigning myself as I'm not familiar with the inners of Slacks VC

Edit:// To confirm though nothing to do with upload specifically, just the transition of going from a different VC and trying to modify text. All the correct delegate calls are being made, it has the URL and text and if you put a breakpoint in the 'replace' helper function the text is updated perfectly

Good chance to get familiar with the inners πŸ˜‰

I can probably fix later if not

Sent with GitHawk

I'll rephrase, I didn't wanna just add a super kludgy fix πŸ˜‚

Possible solutions:

  • Delay the replacement of text until things have loaded
  • or: Call cacheTextView() as soon as we update it

Oh that makes β€œsense”! Nice detective work @Sherlouk

Sent with GitHawk

They don't call me Sherlock for the fun of it πŸ˜‰

You don't have to link to a Wikipedia article for that πŸ˜‚

Sent with GitHawk

I've made the reference before and people have been like who the hell is that πŸ˜‚

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BasThomas picture BasThomas  Β·  3Comments

rnystrom picture rnystrom  Β·  3Comments

BasThomas picture BasThomas  Β·  3Comments

rnystrom picture rnystrom  Β·  3Comments

BasThomas picture BasThomas  Β·  3Comments