Although it appears to be a problem with odd browser behavior (caching, reload?), potential issues in the Ruby code are undetectable and therefore undebuggable because a SketchUp action_callback does not throw errors.
Therefore the execution of Ruby code should be wrapped in something like:
begin
# execution of ruby code
rescue Exception => e
puts e.message
puts e.backtrace
end
Also it adds every elementary operation to the undo stack. When clicking once "insert!", it would be more user friendly to only add one command to the undo stack. This can be achieved by wrapping everything in an operation (either on client side in the action_callback, or in the executed Ruby code):
begin
model.start_operation("operation name")
# execution of ruby code
model.commit_operation
rescue Exception => e
model.abort_operation
puts e.message
puts e.backtrace
end
One can also catch potential JavaScript errors in the webdialog and make them visible/debuggable in the Ruby Console.
Edit: Debuggable version attached. It seems to be a JavaScript error caused by the Prototype library or the usage of it.
[pre:2zs9no9b]Object required [http://sketchup.engineeringtoolbox.com/static/lib/scripts/prototype_1_6_0_2.js:3517](http://sketchup.engineeringtoolbox.com/static/lib/scripts/prototype_1_6_0_2.js:3517): in JavaScript function[/pre:2zs9no9b]