bishopmatthew / HackerNews

An open source Hacker News client for Android.
230 stars 61 forks source link

Submitting to AskHN claims no connection/fail, results in spamming #59

Closed yosyp closed 10 years ago

yosyp commented 10 years ago

When submitting a new AskHN post, the process always claims to fail due to connection issues while in fact posting to the board in the background (both with and without WiFi enabled on 4.3, Kernel 3.4.0-1625098 on a SM-N900A). This resulted in me spamming the board over 13 times in a couple hours. :(

My guess would be the culprit is somewhere around line 265 in src/com/airlocksoftware/hackernews/activity /SubmitActivity.java where neither success or failure is returned due to a perceived connection issue, and the submitting process continues.

Upon further investigation, is there some submit caching system in place? I haven't hit submit through the app in over 9 hours, yet it is still posting new submissions consistently about every 20 minutes.

pkillian commented 10 years ago

Sorry for this; I'll look into it intensely today and keep you posted. I've got a lengthy flight this weekend and will be trying to knock out a few issues, yours being the most severe.

pkillian commented 10 years ago

Confirmed on latest version, running Android 4.4.2; I'll hopefully have this resolved over the weekend. Sorry again for the nuisance!

screenshot_2014-03-19-10-53-26 screenshot_2014-03-19-10-53-42

yosyp commented 10 years ago

Not a problem, thanks for looking at this so quickly! Let me know how I can help, this app is amazing, I'll contribute in anyway I can.

pkillian commented 10 years ago

Looking at it now; will have most of this week free, so I'll keep you up-to-date on any progress.

pkillian commented 10 years ago

Narrowed it down to the fragment manager which throws the error when the load finishes; will consult @bishopmatthew on exactly what could be causing this because I'm not the most familiar with the workflow he's implemented here. We've got a confirmed bug and a code segment to work with though!

pkillian commented 10 years ago

As the pull request says; the SubmitLoader.java fragment loader manager was not correctly validating a response; code was checking if equal to "http://news.ycombinator..." which doesn't handle HTTPS.

pkillian commented 10 years ago

Will review the pull request with @bishopmatthew and close issue afterwards. Thanks again for the bug submit!

pkillian commented 10 years ago

Also, @yosyp; I noticed that your HN account was marked as 'dead' by HN staff. Probably because you posted too quickly with too new of an account. You should contact HN staff and explain what happened. If they give you any flak, feel free to direct them here and I'll personally vouch for you. Sorry again for the inconvenience.

yosyp commented 10 years ago

@pkillian awesome work!! I did email pg right when I noticed that I spammed HN (https://dl.dropboxusercontent.com/u/26434203/hn.png). I'm not sure who else to bug about this (pun intended).

pkillian commented 10 years ago

Well I've added a much clearer mechanism for figuring out the status of a new post; we could easily patch on a timed lockout that prevents your sort of thing from happening.

The duplicate posting probably happened like this: you tried posting it once, HN accepted it but our app said "No connection". Afterwards, you might have hit the button a few more times, but probably not as many as I see under your submissions on HN. The reason you got even more posts after that when you weren't hitting the button was probably because of the saved state of the activity; when the SubmitActivity is loaded, it initiates this sort of "is this a new post, or is the Activity blank?" If it's not blank, it tries to post it, which may have just naively posted it every time you opened the app onto that saved activity.

pkillian commented 10 years ago

Merged into master; closing issue.