Announcement

#1 2013-12-16 10:08:54

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

bug in user_cache_categories

Hi,

2 users have reported me the same bug in less than 7 days: suddenly they can't see sub-albums. Sub-albums visibility is correctly configured. The problem I've found is that user_cache_categories is wrong.

For example:

Code:

mysql>  select id, name, id_uppercat, uppercats from categories where id_uppercat=32;
+-----+------------------------+-------------+-----------+
| id  | name                   | id_uppercat | uppercats |
+-----+------------------------+-------------+-----------+
| 164 | Vatican 2005           |          32 | 29,32,164 |
| 165 | Place d'Espagne 2011   |          32 | 29,32,165 |
| 166 | Villa Borghese 2011    |          32 | 29,32,166 |
| 167 | Forum Romano 2005      |          32 | 29,32,167 |
| 168 | Piazza del Popolo 2005 |          32 | 29,32,168 |
| 169 | Trastevere 2005        |          32 | 29,32,169 |
| 298 | Muse Capitole 1994     |          32 | 29,32,298 |
| 299 | Pont Sisto 1994        |          32 | 29,32,299 |
+-----+------------------------+-------------+-----------+
8 rows in set (0.00 sec)

and:

Code:

mysql> select * from user_cache_categories where user_id=1 and cat_id=32;
+---------+--------+-----------+---------------+-----------+--------------+------------------+--------------------------------+
| user_id | cat_id | date_last | max_date_last | nb_images | count_images | count_categories | user_representative_picture_id |
+---------+--------+-----------+---------------+-----------+--------------+------------------+--------------------------------+
|       1 |     32 | NULL      | NULL          |         0 |            0 |                0 |                           NULL |
+---------+--------+-----------+---------------+-----------+--------------+------------------+--------------------------------+
1 row in set (0.00 sec)

then I create a new album at the root of the gallery and delete it (just to force reset on user cache), I refresh on gallery side, and :

Code:

mysql> select * from user_cache_categories where user_id=1 and cat_id=32;
+---------+--------+-----------+---------------------+-----------+--------------+------------------+--------------------------------+
| user_id | cat_id | date_last | max_date_last       | nb_images | count_images | count_categories | user_representative_picture_id |
+---------+--------+-----------+---------------------+-----------+--------------+------------------+--------------------------------+
|       1 |     32 | NULL      | 2013-12-15 12:19:01 |         0 |           64 |                8 |                           5265 |
+---------+--------+-----------+---------------------+-----------+--------------+------------------+--------------------------------+
1 row in set (0.00 sec)

rvelices (who has worked on user cache), do you have an idea?

Offline

 

#2 2013-12-16 11:06:39

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: bug in user_cache_categories

One user tells me that he has created albums from Lightroom and that it oftens produces an error. He will give me more details about the error message in Lightroom.

Offline

 

#3 2013-12-16 11:17:35

rvelices
Former Piwigo Team
2005-12-29
1960

Re: bug in user_cache_categories

plg wrote:

rvelices (who has worked on user cache), do you have an idea?

Many ws functions do not call invalidate_user_cache (directly or indirectly). Examples:
ws_add_image_category_relations
ws_images_addSimple

Offline

 

#4 2013-12-16 11:19:55

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: bug in user_cache_categories

I've used pwg.images.addSimple so many times with no problem that I can't believe it is the origin of the problem. I'll make test and fix it! Thank you.

Offline

 

#5 2013-12-16 13:15:20

rvelices
Former Piwigo Team
2005-12-29
1960

Re: bug in user_cache_categories

And I just realized the new user manager will not improve things as web service calls never invalidate user cache ...

Offline

 

#6 2013-12-16 13:35:21

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: bug in user_cache_categories

OK, you're right!

Offline

 

#7 2013-12-16 14:05:07

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: bug in user_cache_categories

ws_images_addSimple() calls add_uploaded_file() which calls invalidate_user_cache()

ws_add_image_category_relations() is called by:
* ws_images_setInfo() which calls invalidate_user_cache() at its end
* ws_images_add() which calls invalidate_user_cache() at its end

Offline

 

#8 2013-12-16 16:10:37

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: bug in user_cache_categories

[Subversion] r25968

bug 3012 fixed: invalidate_user_cache() on pwg.users.setInfo, pwg.groups.addUser, pwg.groups.deleteUser

Offline

 

#9 2013-12-17 10:05:04

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: bug in user_cache_categories

[Subversion] r25975 by rvelices : adds invalidate_user_cache() on pwg.groups.delete (+ smarter call of invalidate_user_cache())

Offline

 

#10 2013-12-17 10:06:27

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: bug in user_cache_categories

The user has reported the problem occuring with Lightroom. I have completed it with server logs and sent it to Vladimir (alloyphoto)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact