Page MenuHomePhabricator

[BUG] Internal link to a section in the article takes to to the beginning of the article
Closed, ResolvedPublicBUG REPORT

Description

From OTRS:
"If you follow an internal link for a specific paragraph of an article, the app will take you to the beginning of the article..."
https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom;TicketID=10802590

Steps to reproduce

  1. Open Java_(software_platform) in the Android app
  2. Find on page where objects are allocated on the heap and click on the link

Expected:

The link to the section should take you to that particular section in the article

Actual:

Takes you to the beginning of the article

Event Timeline

Replied to the OTRS ticket and asking for the link of the article that has the issue.

Move this ticket to blocked/waiting and waiting for the response.

Update: the user replied to the OTRS ticket, and looks like the redirected link contains a fragment, which should be handled correctly?

Restricted Application changed the subtype of this task from "Task" to "Bug Report". · View Herald TranscriptMay 14 2020, 1:49 PM

The re-directed url does not give the correct anchor to scroll to. For example in this case it should have been #Dynamic_memory_allocation

Also, it would be better to get this in the link response from mobile-html service than just a url update from page/summary response

Charlotte lowered the priority of this task from High to Medium.Jun 1 2020, 10:19 AM
Charlotte subscribed.

Adding the PI backlog, since we are requesting an update to mobile-html in order to handle this.

Hi @MSantos , @Sharvaniharan !
Does this bug relate to the mobileapps eventually? I've checked the incoming response here.
It seems, that this broken link is building on some other level of the application, because I receive it in response as-is.
Could you point me where to find the source of this bug?

@vadim-kovalenko it looks like Dynamic_memory_allocation is a MediaWiki redirect to Memory_management#DYNAMIC

I'm assuming that the clients want the redirect resolved by the mobile-html, is that right @Sharvaniharan?

@vadim-kovalenko on a second look it looks like we are stripping some custom anchors that should be present on the page, these anchors are created by the Anchor template, like this:

see https://en.m.wikipedia.org/wiki/Memory_management#DYNAMIC source

<span class="anchor" id="DYNAMIC"></span>

I believe that if the anchors are present, the client will be able to work normally.

@MSantos

  1. In Java article there is an anchor tag
<a href="/wiki/Dynamic_memory_allocation" class="mw-redirect" title="Dynamic memory allocation">allocated on the heap</a>
  1. In Memory management article there is a section 'Dynamic memory allocation' which is result of redirection by link from p.1
  1. The 'Dynamic memory allocation' title has span tag with multiple anchors:
<span class="mw-headline" id="Dynamic_memory_allocation">
	<span class="anchor" id="DYNAMIC"></span>
	<span class="anchor" id="HEAP"></span>
	<span class="anchor" id="ALLOCATION"></span>
	Dynamic memory allocation
</span>

As you can see, there are bunch of optional anchors in the 'Dynamic memory allocation' title. So client can use either 'Dynamic_memory_allocation' or 'DYNAMIC' anchor as well.
As per replacing redirect resolving to mobile-html, I need additional clarifications, because I'm not sure what problem it should resolve.

Change 669437 had a related patch set uploaded (by Vadim Kovalenko; owner: Vadim Kovalenko):
[mediawiki/services/mobileapps@master] Fix issue with missing anchor span tags

https://gerrit.wikimedia.org/r/669437

Change 669437 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Fix issue with missing anchor span tags

https://gerrit.wikimedia.org/r/669437