I'm seeing several IllegalStateException crashes due to e.g. having an
alert posted when app's in the background. Need to fix them, but the
debug build crashing isn't helpful. Log.e() instead.
The pesky thing is back. When app's in the background with an
unconnected game open displaying the "resend/wait" alert and the game
connects get IllegalStateException because the fragment stack's being
modified after onSaveInstanceState() (or, because the dialog fragment,
saved as an instance variable in BoardDelegate, dates from an earlier
state. Anyway, catching and dropping the exception and elsewhere failing
silently to rebuild the alert seems to fix the problem, but the right
fix is likely different. I suspect hanging onto that iVar is wrong, and
that the dialog should go away when onStop() is called and then be
rebuilt later from saved state. But for now, not crashing is good.
Got a report of crashes due to corrupt move records. Given I rarely see
them I wondered if it's because the hint- and robot-generated moves I
work with have tiles in order. So now on debug builds tiles in moves
from those sources are randomly rearranged (as if the user had formed
the word in random order.) The bug isn't showing up, but I figure the
test's worth keeping.
Stuff I'm doing with invitation resends is making the relay loop
inifintely. Let's assert a small loop count instead: better to crash and
restart than loop forever unable to process requests.
Remove a bunch of duplicated code, replacing with implementation in
XWService. Fixes duplicate invitation and game opening policies being
slightly different.
The fix I made earlier for this relied on a callback that was skipped in
release builds. Now always take the path that involves making the
callback when one is provided. Also remove an optimization that was
trying to eliminate possible moves based on scores prior to doing the
more expensive full check. In 2018 I prefer simplicity, and can make the
remaining code faster if that's required.
Try some funky layout shite to get, within a horizontal linear layout,
the first text field trucated if necessary so that the second (holding
the score) can be fully displayed. Tested on exactly one emulator so
far.
Try some funky layout shite to get, within a horizontal linear layout,
the first text field trucated if necessary so that the second (holding
the score) can be fully displayed. Tested on exactly one emulator so
far.
I think there's a bug in Weblate because I've seen this before: where
the English provides only an <other> the translation comes back with
only a <one>. That's wrong. Try adding a <one> in the English case to
see if that makes a difference.
I think there's a bug in Weblate because I've seen this before: where
the English provides only an <other> the translation comes back with
only a <one>. That's wrong. Try adding a <one> in the English case to
see if that makes a difference.
Otherwise it takes too long to scroll if you have hundreds of
games. To make this work had to move scroller to left side of games
list display as otherwise the scroller steals events from the expander
thingies.
Likely because of something in the jni world unset per-player dict name
is empty string rather than null, so test for that too. Fixes dicts
popup in newly-created game have an empty first line " (in use)".
I like this better than the previous fix: rather than share a
thread->env map with the game world allocate a new one for each
iterator. This could cause problem if the iterator is used on threads
that don't currently call map_thread(), or if there are callbacks that
need to look up the env that I'm not aware of. Needs testing...
Stumbled on a NPE opening up the wordlist browser configuring the first
game on a new install. So now test for null there and init early if
necessary. Seems to work, and won't do anything in places were not
needed.
Remake the min and max spinners every time either value changes so they
can't be used to set nonsensical values. (Which leads to immediate
crashes.) I'm sure this wasn't always a problem, but...
As reported to google, dict iterator destruction was crashing due to a
race condition if it happened after a game using the same dict had been
closed since it needed a mapped env that the game closure would
remove. Fixed in two ways, one by adding the mapping prior to the code
that uses it (a common pattern: add happens many times, whenver it might
be needed, but remove only once), and second by passing env into the
code that was crashing.
The mapping stuff remains inherently racy and I'm not sure now how to
fix that. It depends on there being a place to unmap after which it's
guaranteed the mapped value won't be needed again. When two
objects (game and dict_iter in this case) map the same env/thread combo
there's a race.
Looks like the assertion was left in when adding support for dual-pane
mode, as all other onPosButton() implementations called super rather
than assert. Which this one does now too.