WildcardSearch / MentionMe

A plugin for MyBB 1.8.x that allows Twitter-style tagging and integration with MyAlerts
GNU General Public License v3.0
20 stars 9 forks source link

Update Name Cache When Plugin Settings Change #213

Closed Eldenroot closed 5 years ago

Eldenroot commented 6 years ago

Profile images are not loaded in popup menu - this is a little annoying bug - if you use avatar picture in .png format it is nor working because mentionme uses automatically .jpg images in the URL.

@WildcardSearch

WildcardSearch commented 6 years ago

Thanks for the report. As I'm sure you've noticed, I am having trouble finding free time right now. When I return I will try to catch everything up.

WildcardSearch commented 6 years ago

@Eldenroot can you give me steps to reproduce. I had some time this evening to try it out, but PNG images are working correctly on my end.

Eldenroot commented 6 years ago

Hi @WildcardSearch - ok, let me explain.

I used avatar with .jpg extension but I convert it to .png one. I tried to rebuild the cache, but mentionme still loads old url of avatar image

As you can see in my browser console, it should be avatar_1.png not .jpg. When I change my avatar back to jpg it works fine...

WildcardSearch commented 6 years ago

You just need to rebuild the name cache (from the ACP Plugins page) before the correct avatar will show. The avatar URL is cached with the rest of the user info.

Sorry, I didn't realize this was the problem or I would have given you this advice when you first created the issue.

Eldenroot commented 6 years ago

Ok, but this task should be run automatically every 24 hours... but this issue with avatar has been there for over 4 weeks, so apparently it is not working somehow.

WildcardSearch commented 6 years ago

Did you try to run the name cache rebuild link?

I'll be home in about five hours and will try again to reproduce the issue. Sorry you are having problems.

Eldenroot commented 6 years ago

Yes I did, after I clicked to link in ACP-Plugins the issue was fixed...

WildcardSearch commented 6 years ago

That might mean that there is an issue with the task running. Can you check the task log to ensure that the task is in fact running once per day?

Eldenroot commented 6 years ago

OK, I will check this tomorrow. I will let you know.

Eldenroot commented 6 years ago

@WildcardSearch - task seems to be fine

image

WildcardSearch commented 6 years ago

Okay check that off the list. Can you go to ACP -> Tools & Maintenance -> Cache Manager and look for wildcard_plugins cache entry -> mention_me section

See if the avatar filename is stored correctly in the cache when you have recently changed avatar extensions.

Sorry to ask you to do so much but I just want to try to find an issue if one exists.

Eldenroot commented 6 years ago

When I change my avatar from .png to .jpg - > there is no change in the cache - still shows .png avatar path. Maybe can you add support for run rebuild cache automatically cache when avatar is changed?

image

WildcardSearch commented 6 years ago

Yes. That sounds like a good idea.

I'll just convert this issue over to an enhancement request for that feature.

Eldenroot commented 6 years ago

Or just maybe make task run time period shorter... much easier :)

WildcardSearch commented 6 years ago

I think the most comprehensive solution is to isolate events that may change the cache information, hook in, and rebuild the cache at these points— much like the rebuild_settings function.

Your thoughts?

Eldenroot commented 6 years ago

Great idea! Is that possible with MyBB existing hook system or some hooks will be missing?

WildcardSearch commented 6 years ago

It would be difficult for me to say without having a closer look, but when I checked yesterday (quickly) it seemed doable by hooking into: the ACP pages for user/group editing, the UCP pages for account changes, and the banning pages.

I'll probably put this off until 3.3, given the large scope of these changes.

WildcardSearch commented 6 years ago

@Eldenroot I took a look at it this evening and there are dozens of places where the user's information can change. There are hooks in some places and not in others, but the main thing I gathered from it was that it would make MentionMe a lot heavier and I don't think we want that.

I am going to go ahead with 3.2.6 and we can keep looking at what can be done about this issue.

Eldenroot commented 5 years ago

OK, I would suggest to refresh the cache when plugin settings is saved... :) As we discussed on Discord

WildcardSearch commented 5 years ago

Done and working on my end, @Eldenroot