gfileinfo: Temporarily downgrade missing attribute criticals to debugs

This partially reverts ed8e86a7d4.

The change to add the criticals (commit ed8e86a7d4) is correct, but
landed too late in the cycle. Let’s downgrade the criticals to debugs
for now, to stop applications seeing a lot of new criticals in their
output. Those criticals are particularly disruptive for command line
applications and unit tests.

Early in the next cycle, the debugs will be re-upgraded to criticals.
This will give applications a whole additional cycle to fix their
ambiguous use of API.

It turned out that a lot of applications have latent bugs around
calling `g_file_info_get_*()` without checking whether an attribute
is set first, and were hence relying on the ‘unknown’ return value
also being an appropriate default for them.

This was compounded by the fact that several non-local GVFS backends
were not setting `GFileInfo` attributes all the time, which caused the
‘missing attribute’ code path to be hit more frequently. For example,
they would only call `g_file_info_set_is_hidden()` with a true value and
never bother with a false one.

It was further compounded by the fact that, while this change landed for
the 2.75.4 release, there did not seem to be extensive integration
testing of that release, and distributions and downstreams went straight
to 2.76.0. That meant we missed the window between 2.75.4 and 2.76.0 to
change, fix or revert this behaviour. GLib relies on distros and
downstreams doing integration testing of unstable releases. We test with
downstream GNOME as part of gnome-build-meta, but do not have the
resources to do integration testing for everybody.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

See: #2907
See: #2932
See: #2934
See: #2945
See: #2948
This commit is contained in:
Philip Withnall 2023-03-21 12:18:37 +00:00
parent 2630b7d2d5
commit 4cad66580b

View File

@ -1500,8 +1500,8 @@ g_file_info_set_attribute_int64 (GFileInfo *info,
*value_ptr = g_file_info_find_value (info, attr); \
if (G_UNLIKELY (*value_ptr == NULL)) \
{ \
g_critical ("GFileInfo created without " attribute_name); \
g_return_val_if_reached (error_value); \
g_debug ("GFileInfo created without " attribute_name); \
return error_value; \
} \
} G_STMT_END
@ -1837,9 +1837,9 @@ g_file_info_get_modification_time (GFileInfo *info,
if (G_UNLIKELY (value == NULL))
{
g_critical ("GFileInfo created without " G_FILE_ATTRIBUTE_TIME_MODIFIED);
g_debug ("GFileInfo created without " G_FILE_ATTRIBUTE_TIME_MODIFIED);
result->tv_sec = result->tv_usec = 0;
g_return_if_reached ();
return;
}
result->tv_sec = _g_file_attribute_value_get_uint64 (value);