soscripted / sox

Stack Overflow Extras: a userscript for the Stack Exchange websites to add a bunch of optional toggle-able features
http://stackapps.com/q/6091/
MIT License
72 stars 15 forks source link

Reply Link disappears #379

Closed Nc432o5 closed 5 years ago

Nc432o5 commented 5 years ago

If you go to this link, you will see reply buttons:

stackoverflow.com/questions/54120867/is-there-any-way-to-print-something-without-using-any-strings-or-numbers-in-pyth?noredirect=1

If you go to the same link but with a comment in the URL (happens when a comment appears in your inbox), the reply links disappear:

stackoverflow.com/questions/54120867/is-there-any-way-to-print-something-without-using-any-strings-or-numbers-in-pyth?noredirect=1#comment95074329_54120867

Note the #comment95074329_54120867 part.

shu8 commented 5 years ago

@Ethan-JK thanks for the bug report! Unfortunately, I can't reproduce this. Does this still happen for you? If so, please could you make sure you're using the latest dev version and could you tell me the environment you're using (browser, userscript manager)? Thanks!

Nc432o5 commented 5 years ago

@shu8 Sure! Here it is:

Installed Version: 2.3.0 Environment: Tampermonkey

Features Enabled

["Appearance-addAuthorNameToInboxNotifications","Appearance-alignBadgesByClass","Appearance-answerTagsSearch","Appearance-colorAnswerer","Appearance-displayName","Appearance-dragBounty","Appearance-highlightQuestions","Appearance-isQuestionHot","Appearance-localTimestamps","Appearance-markEmployees","Appearance-metaChatBlogStackExchangeButton","Appearance-metaNewQuestionAlert","Appearance-scrollToTop","Appearance-spoilerTip","Appearance-standOutDupeCloseMigrated","Appearance-tabularReviewerStats","Appearance-topAnswers","Appearance-unspoil","Appearance-addTimelineAndRevisionLinks","Appearance-showTagWikiLinkOnTagPopup","Comments-autoShowCommentImages","Comments-commentReplies","Comments-commentShortcuts","Comments-confirmNavigateAway","Comments-copyCommentsLink","Comments-moveBounty","Comments-showCommentScores","Comments-hiddenCommentsIndicator","Comments-onlyShowCommentActionsOnHover","Editing-addSBSBtn","Editing-editComment","Editing-editReasonTooltip","Editing-findAndReplace","Editing-kbdAndBullets","Editing-titleEditDiff","Editing-inlineEditorEverywhere","Editing-pasteImagesDirectly","Flags-flagOutcomeTime","Flags-flagPercentages","Flags-flagPercentageBar","Sidebar-hideHireMe","Sidebar-hideLoveThisSite","Sidebar-linkedToFrom","Chat-chatEasyAccess","Chat-replyToOwnChatMessages","Chat-renameChat","Voting-betterCSS","Voting-stickyVoteButtons","Voting-disableVoteButtons","Extras-alwaysShowImageUploadLinkBox","Extras-parseCrossSiteLinks","Extras-quickAuthorInfo","Extras-shareLinksPrivacy","Extras-shareLinksMarkdown","Extras-sortByBountyAmount","Extras-warnNotLoggedIn","Extras-showMetaReviewCount","Extras-copyCode","Extras-dailyReviewBar","Extras-openLinksInNewTab","Extras-showQuestionStateInSuggestedEditReviewQueue"]
shu8 commented 5 years ago

Thanks! Which browser are you running also?

Nc432o5 commented 5 years ago

@shu8 Chrome Version 71.0.3578.98 (Official Build) (64-bit)

shu8 commented 5 years ago

Thanks! I looked into it more, and it seems like in the example you linked, it only doesn't show for the comment on the question (by Samuel Liew DIAMOND) -- and it does appear for a second on page load but then disappears. Is this what you're seeing too?

If it is, it seems like a clash with the Comments-onlyShowCommentActionsOnHover feature -- you could try disabling it until I work out a fix, because it doesn't seem as straight forward as I'd hope after looking at it for a few minutes!

Nc432o5 commented 5 years ago

@shu8 That is what I was seeing. It is less clear now that the conversation has been moved to chat (there was a big discussion). If I remember right, it was not Samuel Liew (who wasn't there yet) but everybody (or was it just one person, I don't remember).

Hopefully, you find a fix!

shu8 commented 5 years ago

Thanks for confirming! I'll have time to look at this after the weekend hopefully :)

shu8 commented 5 years ago

@Ethan-JK I think this only seems to happen when you link to a deleted comment? I'm trying to reproduce again, and it only works on that link because the comment doesn't exist anymore!

Could you confirm please?

Nc432o5 commented 5 years ago

@shu8 Yep, you are right. It only happens on comments that have been deleted. As such, I have steps to reproduce now! Here they are:

  1. Comment on something.
  2. Manually get the #comment[COMMENTID]_[POSTID] tag into the URL by inspecting the HTML for the id=[ID] of both the post and comment IDs.
  3. Copy the URL.
  4. Then deleting the comment.
  5. Paste URL containing the #comment[COMMENTID]_[POSTID] tag into URL bar
  6. Hit enter to load the page with the now-deleted comment.
  7. Poof! Gone! (It may only work when the (show X more comments button needs to show)

It worked for me! I did it on this question, which is mine so nobody gets a notification. I added a comment that looked something like this:

This is so cool when you look into it more.

I then got the comment ID (95800607) and the ID of the question (53772454) from DevTools and combined them like this:

#comment95800607_53772454

I then deleted the comment and added the above to the URL:

https://stackoverflow.com/questions/53772454/truly-private-variables-in-python-3#comment95800607_53772454

Then the reply buttons don't appear! You can click on the link above to see it for yourself. Also as a side note, the show X more comments that SOX adds to the top of the comment section appears, even though the #comment[X]_[Y] part of the URL should make it go away, as the bottom one does.

Oh, I also re-added my comment at the end but with slightly different wording, so you will see my comment that I added:

This is really cool when you look into it more!

However, the bug still happens without re-adding my comment. I just did it because I thought it should be there.

shu8 commented 5 years ago

Thanks for investigating @Ethan-JK!

This seems to be due to SOX not catching some sort of CSS change the sites do when a link to an invalid comment is given.

I've added a tiny delay in the function now, which should be unnoticeable, but should fix the bug!

Please give dev 2.3.31 a shot :)

Nc432o5 commented 5 years ago

@shu8 Yep, you fixed it.

One thing though, if you go to the link I used, which is below.

https://stackoverflow.com/questions/53772454/truly-private-variables-in-python-3#comment95800607_53772454

You will see that the show X more comments button that SOX adds to the top of the comments area appears, but the one on the bottom (the SO one) doesn't. I assume this is the same problem, but just with that show X more comments button instead of the reply buttons.

Clould you fix that too? I would amagine that if would be the same fix and you used to fix the reply buttons.

shu8 commented 5 years ago

@Ethan-JK Thanks, I forgot you mentioned that! I just looked into it and the same fix might work, but I'd rather figure out a better way to fix it without the hacky delay. I'll reopen this so I remember!

shu8 commented 5 years ago

@Ethan-JK Sorry for the extreme delay, but I've now fixed both these issues properly in dev 2.4.36 :)

Nc432o5 commented 5 years ago

It's fine. Nice.