I'm using the AS3 SDK and running into a weird issue. I do something like the following:
Facebook.init(MY_APP_ID, someHandler);
This works ok. At some later point as a result of a user clicking a button in a swf, I do:
Facebook.login(someOtherHandler, {perms:"offline_access,publish_stream"});
Following the user login/approval in the FB popup window, the "someOtherHandler" method is called, but the problem is it is getting called many times - like upwards of 150. In Firefox this is annoying but still works, and I'm then able to make other calls to the API (lookup their account info, post to their wall, etc.). In IE however, this typically leads to a stack overflow. And honestly, even in Firefox this isn't something I want to live with.
If I do a barebones "hello world" type example to try to reproduce the problem I can't; there the callback only fires the expected single time. I'm trying to isolate what could be causing the callback to be called again and again but the system I'm integrating this into is quite large and so it's taking a very long time. That's also why I'm not posting the real code which I know will make it harder for anyone else to help out, but I'm hoping someone's been down this general road before. Thx.
(EDIT - I have verified that Facebook.login is in fact only being called a single time)
Related
After we had performed an upgrade of Rails, we have noticed an issue (or rather a weird behavior) with our application. Specifically, the upgrade from Rails 3 to newer version 4.
The scenario is as follows:
In time to time, when we access the web page, the very first request ends up with page loaded, however HTML is rendered as a plain text (the top part of the figure). After I press F5, the page loads correctly (the bottom part of the figure) and so it does subsequent times (you may see it in the figure below), simply works as expected.
This behavior I consider completely random as there is not deterministic time or situation I can clearly predict it to happen again:
it sometimes happens, when I access the page after longer period of time (a day or two)
it does not happen at all in rare cases (we have carried out tests on various browsers and machines)
Wish I could provide more information on the matter. However, I feel lost at the moment and have no idea, what kind of other relevant application details would be beneficial to resolve the problem.
Either your thoughts or suggestions would be more than appreciated. Thank you.
Edit:
Well, it seems like the behavior takes place once we run the application in the production environment. Additionally, the statement above regarding occurrence of the issue is no more true as it happens on any browser and any machine at the time.
I've been trying to resolve this problem for a while now, I even gave it a shot to rewrite the entire program but without success. The application is running on VueJS 2.3.3 and is supposed to be running on Chromium in combination with a Raspberry Pi (irrelevant information, for now).
We're working with several components which are being included in a single file, later on this file will be compiled using either gulp or npm run dev. When the instance of VueJS initializes, a request will be send using Vue Resource's $http option. This'll receive a json response with a size of around 30mb. This'll be saved in the data array, as seen here:
this.$http.get('<url>' + this.token)
.then((response) => {
this.properties = response.properties;
});
This data will later on be used for further actions, another thing that is worth mentioning is that the data is being refreshed every once in a while. Which is where I think the problem occurs, if I'm not refreshing the data every 5 minutes (can be longer too, really depends on the way I'm testing) the program runs fine. It's just that I want to refresh the data every once in a while to retrieve new information. The way of setting a timeout which I'm using is as following:
this.dataTimeout = setTimeout(this.refreshData, 300000);
Each (so called) property has at least 6 base64 images saved in it's JSON, which are later used to present to the user. Besides that, there is a name, address, and some other tiny bits of data. It doesn't sound all that wrong but I'm getting the feeling that each response makes the memory grow so intense that even a desktop is getting trouble running it.
Each 10 seconds a new property will be presented on the user's screen including the images, street, location, etc. I'm not sure if there is a memory leak in my code or if I'm forgetting something. A few questions pop up in my head:
Do I need to reset the response I'm getting from the server back to
null or undefined?
Could there be a leak in one of the plugins I'm using (Just VueResources)?
For how long can a VueJS instance stay alive, is there any recommended time to reload the entire program?
What thinks should I take in consideration in order to achieve this at all?
I've taken out the data renewal and put a demo project online, this can be seen right here. The main problem I'm having is that the browser just runs out of memory and shows us the amazing Aw snap! page from Chrome. I tried taking snapshots from the memory usage but it all seems fine, it just explodes randomly after a while.
Well, I don't know what really does your app, but are your 30Mb of data really useful / essential ? In JSON moreover ?
Maybe you don't need all this data, and you could just adapt the data to your needs. For example, keep your JSON store data, and retrieve your Base64 images by another way.
I don't understand why you store in memory images. Images are just useful for display purpose in my opinion.
So I think 30Mb is really huge. But maybe I'm wrong ?
By the way, I've tested with Firefox Nightly, no problem here. Doesn't seem to crash. Maybe I don't encounter the refresh call ?
I am a Google App Script user since last 2 years. I see here in India during peak time i.e during evening the 1 minute trigger is not firing at proper time. Is there any server side issue or there is some other issue. Saying about the worse case scenarios, today my script trigger has not been fired since past 2 hours. I have correctly done logging. No log is printed means it does not even go to that method. Can anybody tell me what might be the exact reason behind it.
It might be beneficial to show us the code behind your script, given that there is a method that is potentially being skipped over. Have there been no errors thrown to you via the Google Apps Script notifications?
It seems, perhaps, your issue may fall into place with this currently reported error: https://code.google.com/p/google-apps-script-issues/issues/detail?id=2708
We're likely not going to be able to give you a precise answer to your problem if we can't examine what you're currently working with. I wish you luck in your endeavor, though.
Well, I do hate asking vague questions but I can't help it this time:
Some macros I'm coding are taking a long time to run - and I just realized that it's incredible boring to just wait for it.
I want a progress bar. Or even a message box stating "Loading..." with a cancel button.
I tried using MS help to do this, but they require an ActiveX controller and that's just not an option.
Personally, I really didn't even try to code anything becouse I'm not even sure if it's possible! Everytime I open a MsgBox the whole program stops running, and that's not my idea.
I tried checking some concepts in C+ or Java, but most people seem to use a function just for that.
Anyway, any kind of lead or small piece of information would help a lot.
PS.: Yeah, I'm using Access 97, and that's not something I can change in the moment.
The problem with using MsgBox is that it stops everything until it gets a user response. That's not what you need for this.
Try making a very simple Wait form. It would have 1 unbounded label that says "Please Wait". Before your calculations begin, call it up with a docmd.OpenForm(... and close it when you're done with a docmd.closeform(...
I'm building a RoR site, and today I get the pagination done. Upon showing it to my coworker, his first question is "what happens if you set the querystring to "?page=-1". It died with a runtime exception (error 500). He suggested that that should definitely be fixed before this site goes anywhere near live.
I happen to disagree with him (hear me out). Now, I've been in the web dev business for all of four months, so I very well could be wrong. But I would think that this isn't a big deal. I would think that, so long as said errors do not constitute a security risk, things like this shouldn't be a priority. The only way to cause this error is if you manually edit the query string, and, well, garbage in garbage out. If you're smart enough to know that you even can edit the querystring, you should be smart enough to not give it a negative number.
What is the general consensus on things like this? Do you completely idiot proof the site, so that no matter what the query string is, you never generate an error? Do you let things slide so long as it works the way it's supposed to (and doesn't expose a security risk)? Somewhere in the middle?
EDIT: Somehow my question didn't really come out completely as I intended it. The crux of my question was, where to draw the line between proactively correcting for things versus not doing them. If there's invalid input in the get string, for instance, would it be better practice to display a tasteful error as suggested in the posted replies, or to try to figure out what the user was doing, and do that. Or, as a more concrete example: If a user sets page=-1 in the get string, would it be better to silently assume they meant page=0, or to display some kind of tasteful error page saying somethign like "invalid page specified"?
You should be error checking anything that comes in from the query string. If you get an invalid page number, you should have an error message that's a little more graceful than the Error 500 page. Maybe a sorry, bad request. Try this: <possible suggestions>. It's just plain sloppy and unprofessional to knowingly and deliberately leave an easily accessible error like that on a live site.
You say you're new to web apps, but if your previous dev experience was other GUI apps being used by the "general public" (non-developers, non-techies), would it have been OK to have stack traces thrown into the user's face as the app falls apart around them? In my experience, this is never really acceptable.
You make some good points, but an incorrect query string can have many reasons. For example, a link to a record that has since been deleted. Or a Google result pointing to a page that doesn't exist in the current result set any more.
In these cases, you should show the user something a bit more verbose than a 500 error.
If you have an error-page that looks nice, and gives a polite message, I'd say it's fine. Though I might consider responding with a 404 instead. Garbage in should preferably not produce an error.
I don't think a 500 error page is very meaningful to your average user. At least tell him something is wrong with your page and guide him back on the right track by providing a link to get back to your site.
Sometimes I redirect users to a page that is likely to what he wanted. So when a query goes below zero and this is not permitted, redirect your user to ?page=0 and maybe display a message on top of that page. I think you should prefer this method because it is a better approach in terms of user experience to not use modal windows.
I agree with you, that error messages are necessary and useful but you should try to differentiate, e.g. give an 404 where the user requested a page that doesn't exist.
It varies from project to project. How many users do you expect? If it's below 10K visitors a day it might not be so bad. What percentage of users do you expect will hit the problem? I don't expect that very many but you would know best.
The goal should be to ship the product and roll out improvements regularly. Hopefully the product is sound overall.
Regarding a solution, if its a page not found, a 4xx error should be thrown instead of a 5xx. 5xx errors typically warrant a deeper look and while it's hard to write an air-tight application directly on launch, you should try to have a generic handler for 4xx and 5xx errors.
In the PCI game (Credit Card Verification / Validation) the rule is validate everything and allow for no idiots. So the answer depends on your application.