aldrinbaroi / mediawiki-page-attachment

Automatically exported from code.google.com/p/mediawiki-page-attachment
Other
1 stars 1 forks source link

Wrong attachments displayed when opening 2 pages #70

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open 2 wiki pages at the same time, one containing attachments and one 
containing no attachments (or simply containing different attachments)

What is the expected output? What do you see instead?

Both pages will show the same set of attachments instead of the correct 
attachments for each page.

In other words, let's say page A has 0 attachments and page B has 2 
attachments.  If I open both pages at the same time (opening tabs in the 
browser), either 0 attachments will be shown on both pages or 2 attachments 
will be shown on both pages (depending on which page I load last), instead of 
the correct attachments.

What version of the product are you using? On what operating system?

  PageAttachment version  : 3.1.0
  MediaWiki version       : 1.19
  PHP version             : 5.3.3
  Database name           : MySQL
  Database version        : 5.1.66
  Operating System name   : Debian GNU/Linux
  Operating System version: 6.0.7

Original issue reported on code.google.com by t...@cyrius.com on 11 Apr 2013 at 11:06

GoogleCodeExporter commented 9 years ago
Here's an example site to reproduce this issue.  Note that this site is 
temporary and will go away.

Go to http://sandbox.spdx.org/index.php/Technical_Team/Minutes

Scroll down to the March 2011 minutes.

Open the 2011-03-08 and 2011-03-15 minutes in separate tabs.. you have to be 
quick (i.e. they have to load at the same time).  I use middle mouse click.

If you open 2011-03-08 and then 2011-03-15 you'll see no attachments.  Reload 
the 2011-03-08 page and you'll see that it actually has 2 attachments.

Open 2011-03-15 first and then 2011-03-08 and both will show 2 attachments.  
Reload 2011-03-15 and you will see there are no attachments

Original comment by t...@cyrius.com on 11 Apr 2013 at 11:12

GoogleCodeExporter commented 9 years ago
Hi tbm:

Are you opening the wiki pages from the same browser on the same computer?

Also, could you check if you have two PHP sessions or just one?

Sincerely yours,

Aldrin

Original comment by Aldrin.Baroi@gmail.com on 12 Apr 2013 at 5:40

GoogleCodeExporter commented 9 years ago
> Are you opening the wiki pages from the same browser on the same computer?

Yes, it's in the same browser on the same computer.  And you have to open both 
pages so they are loading at the same time.

It seems that the module doesn't keep state properly, i.e. when you load a 2nd 
page the 1st page receives the same state and loads the attachments from the 
2nd page rather than from itself.

> Also, could you check if you have two PHP sessions or just one?

How do I check this?  Do you mean PHP on the server?

Original comment by t...@cyrius.com on 12 Apr 2013 at 9:14

GoogleCodeExporter commented 9 years ago
Hi tbm:

sorry, been busy...

If you are using Firefox, you can install "HttpFox" extension and enable it 
during you testing and use it to see the "cookies".  Mediawiki's session cookie 
is usually named "mediawikiwiki_session"

Example:

  mediawikiwiki_session=71b2caba8e6e7c07c6aaf47831459271; path=/; domain=www.mediawiki.org; HttpOnly

Check if the "" values are same or different.  If the values are same then it 
is working the it should be.  However, if those are different then there is an 
issue.

Let me know.

Sincerely yours,

Aldrin

Original comment by Aldrin.Baroi@gmail.com on 15 May 2013 at 6:38

GoogleCodeExporter commented 9 years ago
Hi Aldrin,

Yes, I was using Firefox but I see the same behaviour with Chromium.

I just installed the HttpFox extension.  The value for spdx_mwiki_session are 
the same in both cases.

However, it's not working as it should be.  PageAttachment displays the wrong 
attachments when loading two wiki pages at the same time.  Please take a look 
at my original message to see how to reproduce this issue - you don't need an 
account on the wiki to reproduce it.

Original comment by t...@cyrius.com on 15 May 2013 at 7:44

GoogleCodeExporter commented 9 years ago
Hi tbm:

The timing could be causing the issue you are seeing, here are the reasons.

PageAttachment uses session to store current page being displayed under a 
"PAGE_INFO" key. In both pages you are seeing the same session key even though 
your you opened two separate wiki pages.  So, both of them are sharing the same 
session store.  Consequently, based on the timeing, one of the page info 
getting picked up by both pages and so you are seeing same attachments on both 
pages or nothing.

I'll explore this a little further to see if anything could be done to prevent 
this.

Sincerely yours,

Aldrin

Original comment by Aldrin.Baroi@gmail.com on 12 Jun 2013 at 8:07

GoogleCodeExporter commented 9 years ago
We have the same problem. Would be great if this could be solved.

Original comment by marc.fau...@gmail.com on 26 Sep 2013 at 9:57

GoogleCodeExporter commented 9 years ago
I can still reproduce this, btw.

Original comment by t...@cyrius.com on 26 Jun 2014 at 10:29

GoogleCodeExporter commented 9 years ago
Finally got a chance to investigate the issue thoroughly... and identified the 
root cause:  code is returning attachment for the current page identified in 
the session.

This can easily be fixed by using the requesting page's title and then return 
attachments for that page.  However, doing so will break upload and attach 
functionality.

Need to think it through and see whether this can be accommodated without 
breaking the upload and attach functionality and anything else ... (need to 
investigate further). 

Original comment by Aldrin.Baroi@gmail.com on 26 Mar 2015 at 7:53