Re: About gsettings aborting on unkown schemas

On 2011-05-27 at 18:17, ecyrbe wrote:
> > > Of course it is.  With this bug, programs crash where they other-
> > > wise could limp on.
> >
> > potentially eating away data? without schema you don't have a default to
> > fall back to for application preferences and for state. it might end up
> > deleting existing account data, for instance. or eating your files.
> >
> nope, what you don't seems to understand is that you don't let the calling
> program deal with it.

and how do you propose to deal with that? if you allow the application
code to run then *anything* can happen, by definition. what's to say
that an app developer or a plugin developer decides to still go on and
not write sensible code? or tested code: a missing schema is an
installation issue, and people barely test error paths.

this might be acceptable for application developers and their own code,
but this sort of carelessness in designing a platform API is simply
not acceptable.

> With this behavviour
> you now have to protect your code from crashing by checking everytime that
> the schemas (or even the key) exists.

no, because the schema *has* to exists. why would you want to protect
from an abort()? don't you use g_assert() to protect internal state? you
might certainly not do that, but gtk+ does in multiple places. do you want
to have a callback for gracefully showing an error dialog?

> No data is eaten if the calling application show a gracefull message and
> exit from itself.

you cannot guarantee that for every application, unless the library
itself shows that error dialog — an error dialog that will essentially
be useless for the user ("Schema not installed. Reinstall the
application"; well, what now?). GIO cannot show error dialogs, so it
does the next best thing: abort() with an error message meaningful for
the developer in the error log, which will be caught by the desktop-wide
system service for application crashes, and will send a bug report.

what we need is a way for the Shell and for applications to be able to
validate the existence of a schema for their plugins.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]