Recursive Member Requests via AJAX Causes Bugs
Page 1 of 1
Recursive Member Requests via AJAX Causes Bugs
Hi,
This is rather a very technical problem, so if any of you would be able to report this to the higher ups for clarification, I'd love you for that.
Description : When sending recursive requests to the profiles, after about 50 or so I begin to experience some wonky results. Which are :
1. When trying to view a user's profile it's never the correct user associated with the id. e.g. Viewing user 1 would show user 5
2. When trying to view a topic it always goes to topic 1.
Demonstration :
Example of what I'm doing :
Result after prolonged use :
It's like I'm playing some kinda random user game !
Solution / Quirks : I can stop this buggy result from happening after clearing my cookies ( usually just the session id ) or logging out. HOWEVER, I can send plenty of AJAX requests to the user page while logged out and NEVER get this wonky result. I wouldn't have a problem with this, but I need to be logged in to edit the user profiles.
Code : I whipped up an example code similar to what I'm doing. Go to your forum while logged in, press F12, go to console and paste the following code :
The requests are delayed 1 second after they're completed. I tried raising this to 3 seconds, 5 seconds, and even 10 seconds, but I still end up with the same result. What I don't get is that I can continuously get members profiles while logged out without this happening. I'm assuming it has something to do with cookies or I could be wrong.
Why am I doing this ? : I'm doing this because I need to check the user information AND update a specific profile field to reflect the user's achievements.
If you need more information lemme know. Have a good weekend.
This is rather a very technical problem, so if any of you would be able to report this to the higher ups for clarification, I'd love you for that.
Description : When sending recursive requests to the profiles, after about 50 or so I begin to experience some wonky results. Which are :
1. When trying to view a user's profile it's never the correct user associated with the id. e.g. Viewing user 1 would show user 5
2. When trying to view a topic it always goes to topic 1.
Demonstration :
Example of what I'm doing :
Result after prolonged use :
It's like I'm playing some kinda random user game !
Solution / Quirks : I can stop this buggy result from happening after clearing my cookies ( usually just the session id ) or logging out. HOWEVER, I can send plenty of AJAX requests to the user page while logged out and NEVER get this wonky result. I wouldn't have a problem with this, but I need to be logged in to edit the user profiles.
Code : I whipped up an example code similar to what I'm doing. Go to your forum while logged in, press F12, go to console and paste the following code :
- Code:
window.member_crawler = {
index : 0,
quota : 100,
data : '#field_id-6',
get : function() {
if (++member_crawler.index <= member_crawler.quota) {
console.log('Getting user ' + member_crawler.index + '/' + member_crawler.quota + '...');
$.get('/u' + member_crawler.index, function(d) {
var name = $('#cp-main h1', d).text(),
field = $(member_crawler.data, d).text();
console.log((field ? name.replace(/All about /, '') + ' = ' + field : 'USER NOT FOUND.') + '\n\n');
window.setTimeout(member_crawler.get, 1000);
});
} else {
console.log('COMPLETE!');
}
}
};
member_crawler.get();
The requests are delayed 1 second after they're completed. I tried raising this to 3 seconds, 5 seconds, and even 10 seconds, but I still end up with the same result. What I don't get is that I can continuously get members profiles while logged out without this happening. I'm assuming it has something to do with cookies or I could be wrong.
Why am I doing this ? : I'm doing this because I need to check the user information AND update a specific profile field to reflect the user's achievements.
If you need more information lemme know. Have a good weekend.
Re: Recursive Member Requests via AJAX Causes Bugs
Well, I wrote a workaround solution for what I'm doing, so I'm not too worried about this anymore. However, I still think this should be reported when possible, because it appears to be some sort of bug.
There's no rush though, take your time.
There's no rush though, take your time.
Similar topics
» .ajax() vs .get() -> get = 1 request and ajax = 2 requests???!!!
» help set ajax cookie
» Ajax response html
» Ajax reply - all versions
» Ajax or Json and Jquery
» help set ajax cookie
» Ajax response html
» Ajax reply - all versions
» Ajax or Json and Jquery
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum