@UberGoober If a position is changed, then you’re doing a save constantly as it’s being moved. From my example above, it looks like it takes .6 seconds per save and it gets buffered up and the updates continue until all the updates are done. I’ll have to add more code and see how it affects what else is running.
@Steppers yeah for a self-modifying project you will see issues if you use non-coordinated read/writes. For modifying other projects you probably won’t see issues, but if those projects are currently open in the Files app, or, say if Codea one day supports loading multiple projects at once, you might see issues.
@Simeon Ran into a problem with version 280. The code would not execute, it just stayed in the editor. I pressed the run icon at the top right, nothing. I pressed the run icon on the top right of the keyboard, it turned white but did nothing. I long pressed on the upper right run icon and it displayed the “Save and Run” selection. I pressed that and nothing. The editor worked as normal, I could delete and add code. I exited the editor and went back in. Tried to run the code, but nothing. I exited Codea and went back in and everything was OK.
@Simeon So far I’ve had the problem of the code not executing 3 times. I can’t make it happen, but the conditions that was causing it was going into a possible infinite loop and having to force stop the code, but not exiting the editor.
@dave1707 - could you post some of your code. I’d like to know what area we need to focus on to see if we can narrow this down.
Just in general, recently I’ve found response to touch on my iPad getting poor. Sometimes needing a long touch to run from the editor. I was suspecting degradation of the screen protector or the screen itself - my pad does get some hammer.
Have modifications in iPadOS wrt touch changed - is it a result of upgrading iPadOS to meet the demands of metal?
@Bri_G@Simeon I don’t have the exact code that was causing the problem anymore. But what I was doing was reading a large string and displaying small chunks of it to the screen, line after line. What I suspect was happening was that I was going into a tight loop reading the string but not displaying anything. Or possibly reading past the end of the string and not realizing I was supposed to stop. I would be able to stop the program without having to force close it, make changes, but then it wouldn’t execute until I exited Codea. I’ll try writing something again and see if I can force the problem.
@Simeon@dave1707@Bri_G I had this happen to me too, yesterday. I don’t know if it had anything to do with it, but my project was also experimenting with heavy loop usage. I was trying to see if I could use coroutines to create a loop that I could break out of with a button press. Never got it to work, by the way, but I did see this bug.
I’m still getting the project-reversion bug, now it seems like it happens every time I run a project that writes to tabs. It’s getting maddening. @Simeon if automatic save on run would fix this I am emphatically in favor of it.
@Simeon@dave1707@Bri_G I’m getting this bug consistently now. I’ve been using my breakpoint code in conjunction with debug.sethook() to create a primitive step-by-step debugging system and every time I use it, when I exit to the editor the play buttons no longer work.
@UberGoober Can you cut your code down as small as you can and still get the problem. Then post the code. That will help @Simeon fix the problem. That way he’s not spending time trying to write the code to cause the problem.
@dave1707 good point. I had thought maybe it would be obvious to @Simeon what was going on without any more information, but when you point it out, that seems like rather muddled thinking on my part.
This reproduces it:
-- PlayBug
parameter.boolean("breakpointsEnabled", false)
breakpoint = function()
if not breakpointsEnabled then return end
print("tap tab to advance a line, type 'qq' to exit breakpoints")
local buffer = ""
showKeyboard()
while buffer ~= "\\t" do
buffer = keyboardBuffer()
bufferLength = string.len(buffer)
buffer = string.sub(buffer, string.len(buffer)-1)
if buffer == "qq" then
buffer = "\\t"
breakpointsEnabled = false
end
end
hideKeyboard()
end
function trace(event, line)
if not breakpointsEnabled then return end
local s = debug.getinfo(2).short_src
print(s .. ":" .. line)
breakpoint()
end
function setup()
needToStartDebug = true
end
function draw()
if needToStartDebug then
debug.sethook(trace, "l")
needToStartDebug = false
end
for i=1, 2 do
i = 0
end
end
Run it, toggle breakpoints on, tap ‘tab’ a few times to advance a few lines, and exit to editor. Play button no longer works. At least, for me.
@Simeon I mentioned the project not running problem farther above and I wasn’t using a set hook call. I was doing a lot of looping in the code and would stop the code to make changes. After making changes, the run icons wouldn’t work.