GAS Debugger immediately closes itself upon error; some questions about debugging - debugging

I have a script that I'm trying to debug, but the debugger immediately closes itself when it hits an error and dismisses the error message. I could manually open the log and wait for it to load every time I hit a stop, but that wastes a lot of time when it could just pop up on my screen. I figure it has to be an easy fix and I probably did something stupid, but one gets pretty tired of Google's shit when you've read blog headlines such as "THE 6 DEADLY SINS OF GOOGLE APPS SCRIPT ADD-ON DEVELOPMENT" for the 50th time in as many search queries. Anyways, rant over.
When I hit debug, the debugger will run, a white tray pops up at the bottom of my screen and stays empty. When it hits an error, it will flash the error message across the top of the window and immediately close/dismiss that error as well the tray that popped up. The tray looks like the one in the image below, except completely empty.
Has anyone else had this issue and know why it might be happening? Also, can anyone tell me if there is a Matlab-style workspace explorer that displays each user-defined variable and what kind of data it holds? I would find that extremely helpful in debugging. That, and a live in-window console/log.

This is a known issue. Star(on the top left) the issue to let Google know that you're affected and for the issue to be prioritised. Some of the features you requested is already in development
New IDE features Monaco for cutting edge code editing, streaming logs, reliable debugging and Material design. Seamless integration into the G Suite Developer Hub lets users design, develop, deploy and manage their projects all in one place.
In the meantime, You can use clasp in your local IDE.
Related question:
V8 engine no longer breaks on errors

Related

When Using Firefox, Zoom Launches Invalid Meeting ID

The title pretty much describes it. At seemingly random times while I am browsing in Firefox my Zoom desktop application will start and show the message
Invalid meeting ID
Please check and try again.
Simultaneously, a new tab will automatically open to my organization's authentication web page. Something seems to be trying to start a non-existent Zoom meeting, but I have no idea what or why. I am not signed into Zoom, Zoom was not running in the background, I have the setting "Start Zoom when I start Windows" unchecked, and I have no scheduled upcoming meetings at the moment.
I have googled every combination of terms I can think of, but the only potentially relevant item I found was a question from 2017 on Mozilla's support site:
JimWilliams
11/28/17, 6:15 AM
Every time I open Firefox it opens a nonexistent Zoom Meeting where it tells me the host has not joined the meeting -- takes too much time. Help!
There is no reason I can find that a Zoom Meeting window opens every time I open Firefox -- I even signed up for Zoom so I could make sure it didn't show I had any meetings scheduled recurring or otherwise. But having done that and rebooted -- a Zoom Meeting window opens asking me to join a nonexistent recurring meeting where it indicates it is waiting for the host to initiate the meeting. Takes forever (it seems). How can I end this problem?
[...several unhelpful replies hidden...]
jscher2000 - Support Volunteer | Top 10 Contributor
11/30/17, 9:23 PM
In Firefox 56 and earlier, with the old "new tab page," sometimes a tile from history would trigger an odd behavior such a message that Firefox wanted to launch a different application. The approach to that was to remove any tiles that might trigger the unwanted behavior. I don't know if that is an issue with the new "Activity Stream" page, or whether you have that page as your home page.
Example old thread: Why does another application launch when I open a new tab? Plug-in is in Firefox and I can't get ride of it.
This question seems to match my own, but the reply blames an old version of Firefox (I am using Firefox 102.0.1) and the new-tab page (which I don't think I had open when this problem occurred). However, based on the thread's suggestion, I deleted every page from my browser history containing the term "zoom" and I'll wait to see if doing so resolved the bug.
(P.S. I apologize to the mods for the zoom-sdk tag. I can't find an existing tag relating to general Zoom questions. Please feel free to edit if you have better tag ideas.)
So far, removing any Zoom-related tiles on the new tab page and deleting any page from browser history mentioning "zoom" seems to have worked. The only question that remains is why this is still a bug in Firefox after so many updates.

IE11 performance profiler not giving any results

I'm trying to improve my site's performance in IE11 and I cannot seem to get any results out of the performance profiler. I've read this page and it seems pretty straightforward but I must be missing something. Here are the steps I take:
On the F12 tools Performance tab, I click on either the green play button or the "Start profiling to begin a performance session (Ctrl+E)" link.
I perform an action in my app (as simple as clicking on a field and back out)
I hit the red stop button or the Stop profiling to generate a report (Ctrl+E) link
The Profiler tab shows "Analysing the collected data:" with an empty progress bar. The progress bar never goes anywhere and after a few seconds the Profiler tab just reverts to saying "Start profiling to begin a performance session (Ctrl+E)".
This happens on any website that I try, not just mine. The rest of the F12 tabs (DOM, Console, Network) all work fine. Using IE version 11.125.16299.0, update version 11.0.49 on Windows 10.0.16299.
What am I doing wrong?
I don't think you're doing anything wrong. The performance profiler appears to be unable to show the reports it generates in IE11 right now. However, the fact that IE and Edge seem to share their debugging tools (in Windows 10 at least) might offer a viable workaround.
Press CTRL-E, perform your actions, press CTRL-E again, and wait for the performance tab to revert to its initial state. Some part of the profiler seems to have crashed at this point; you'll find that the "import" and "export" buttons won't work.
Exit the debugging tools, open them again, and open the performance tab.
Click on the (now operational) "export" button to save your profiler report.
Open Edge, start its debugging tools, and go to the performance tab.
Import your saved profiler report. It'll show up just fine now.
For what it's worth, importing your saved report into the IE11 debugging tools will result in an error about "Promise" being undefined or somesuch. This makes sense, as the ES6 Promise constructor is supported by Edge but not by IE11.

Visual studio extreme lag spikes while debugging

When Im debugging my app in VS2012 and it crashes, the input (mouse and keyboard) starts to lag extremely, the fps drops to about 0.3 or less and I can't even move my mouse without waiting 3 seconds... The only solution is to do Shift-F5 which will end the debugging, and everythng is fine then again.
Whats more interesting, the only lagging thing is the input, the whole background works perfectly fine, text caret is blinking at normal rate and tooltips are nicely animated when mouse gets over a button.
Im compiling the project with allegro 4.2 (I have to use it, it would take too long to explain why).
I have no extensions, a pretty fast pc which should be able to handle debugging...
Im interested in any solution, it may be dirty/hackish... I can of course provide more information if needed.
Thanks for any help.
EDIT: Reading through forums I found some information about the "Auto" window or something like that (don't remember exactly and can't find it anymore), which is doing some "background tasks" and that causes lags... Do you think running it on separate core would fix that?
A tale of multi-second stalls when hitting a breakpoint, related to the raw input API: http://the-witness.net/news/2012/12/finding-and-fixing-a-five-second-stall/ (archived)
It's a very long time since I last saw this sort of thing myself, but I seem to remember that the culprit in my case was DirectInput. (This makes some sense, given the tale above, as DirectInput has long been a wrapper over the raw input API.) And I think the solution was to use the emulated keyboard and mouse devices rather than the default ones, which you do this by passing in one of the emulated device GUIDs to IDirectInput8_CreateDevice. Discussed briefly here: http://msdn.microsoft.com/en-us/library/windows/desktop/ee416845%28v=vs.85%29.aspx
(I don't remember whether cooperative and exclusivity levels made a difference - it might be worth trying changing these too.)
I recently experienced the following similar issues while debugging a game:
Hit a breakpoint, halting the program for debugging.
Pressing any key now takes around 1 second to "process". It will be buffered and sent slowly one after another to whatever window is now active.
In my case, the application installed a low level keyboard hook with SetWindowsHookEx(WH_KEYBOARD_LL, ...). After removing this (for !NDEBUG builds only as you wish), the input lag was gone.
I suppose the hook cannot respond at all while your application is halted, and eventually the system skips it after a timeout, which length can be configured in milliseconds under HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout:DWORD as mentioned here. In fact, the link in the accepted answer mentions this issue, but I thought I explain the core of it right here, also because the link went dead before I fixed it.
Try to find such a hook in your application or dependencies, and check if removing it helps. Since you mentioned this happens to your mouse too, check for a (low level) mouse hook (WH_MOUSE_LL) aswell. The available hooks are listed on MSDN.

Instruments' UI Recorder hi-jacks my entire system

What am I doing wrong here? :(
I open Instruments.app, create a new UI Recorder template, select my application's .app bundle from the Target -> Choose Target menu, hit Record, open a couple of documents, type some stuff on them, close the documents, quit the app.
At this point UI Recorder stops and the Record button changes to "Drive & Record". I hit it, I see my application get launched and Instruments start recording data. Then Instruments gets confused (somehow)... my application loses focus, and suddenly UI Recorder is replaying all of my actions in Instruments!!, which just screws with Instruments in all kinds of messy ways. In this state I'm unable to move the mouse (the system just steals the cursor back), and I'm unable to quit instruments, since when I hit CMD+Q I'm prompted to Save the document, which I can't do because I have no control of the keyboard or mouse.
This is really frustrating. Has anyone got experience with this tool who can tell me where I'm going wrong? I'm scared to run it a third time as it literally hijacks my entire system.
So, you have a memory leak, and it happens when you do a specific series of actions.
The hard way to debug this would be to just have the Allocations and/or Leaks instruments and do the actions yourself every time, and every time you screw up (leave something out, do something wrong), kill the process and start over.
The easy way is the UI Recorder.
The first time you record with it, it records your actions (at the events level, not the target-action level). Mouse movements, clicks, etc.
The way UI Recorder differs from other instruments—which is why it surprised you—is that when you record with it thereafter, it plays them back.
It's not just swinging around your mouse cursor willy nilly; it's doing what you did the first time. Every time after you do things the first time, the UI Recorder does the exact same things for you.
That's what UI Recorder is for: Perfect, mechanically-ensured reproducibility. It's doing what it's meant to do; it's working as it should.
And yeah, aborting that is hard. I haven't looked yet, but there may be a stop-recording global system hotkey you can use. There is one when Instruments is in mini mode.
Also, you can set whether UI Recorder is in “drive” (playback) or “record” mode in the little pop-over that comes up when you click on the (i) button for the instrument. Switch it to record mode to re-record your interaction for different results in future runs. (I don't know whether it preserves the recording(s) in past runs.)

Visual Studio 2005 hangs when debugging the Winform application

My Visiual studio hangs all of a sudden when debugging the windows application. It's takes while to repond and but it's closing my application. I keep getting this issue everytime in every debugging session.
Please help to fix this problem.
Your application also stops responding right? If so, I presume that your application is giving VS problems. Presumably because some operation is tying up the main thread. When that is tied up no other events can be processed (button clicks, screen redrawing, close buttons, etc). That could be caused by an infinitive loop, or perhaps Disk IO or waiting for a network connection or a database query result, or a deadlock.
My suggestion would be to do some type of logging so you can identify where the problem is at. For instance, put a breakpoint at the top and bottom of major functions. After you break at the top one, hit play. If you don't hit the bottom one you know that the problem is somewhere in that area.
Or, do some sort of logging like putting Console.WriteLn("Entering MyFunction()") at various places in the code.
Once you know where the problem is at, you can fix it.

Resources