| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Avoid keeping a hard ref while notifier events are being dispatched, this
makes the TrackerNotifier lifetime completely in control of the user.
|
|
|
|
| |
Instead of figuring out from the subscription later on.
|
|
|
|
|
| |
Figure the service IRI early on cache struct creation, so we do not need
to rely on subscription+notifier to create it afterwards.
|
|
|
|
|
| |
Avoid poking the notifier for this, passing the cancellable for async
operations with the cache struct itself.
|
|
|
|
|
| |
Try to decouple the dependency on cache->notifier in code. This is a good
start.
|
|
|
|
|
|
|
|
| |
While handling the URN query cursor, we did not check the cancellable
and went all through with it, even if TrackerNotifier finalization
paths might have cancelled the task. This could not happen in practice
since the cache struct takes a reference on the TrackerNotifier, but
will happen with future commits.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the TrackerNotifier::events signal ensured to be emitted in the
same main context that created the TrackerNotifier. This is coherent
with other threaded objects that have communication through signals
(e.g. GDBusProxy).
Notably, it is already expected to behave this way in tracker-miners.
Since the tracker-miner-fs-3 D-Bus endpoint is managed on a distinct
context/thread that should also handle the proxying of notifier events
without involvement of the main thread/context.
|
|
|
|
|
|
| |
Parameters bound to a bus TrackerSparqlStatement would
be leaked on statement execution. The GVariants are already
owned by the hashtable.
|
|\
| |
| |
| |
| |
| |
| | |
build: Detect appropriate strftime() year modifier at build time
Closes #402
See merge request https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/593
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Different libc implementations (or different platforms) have different
bugs. Even though %Y is documented as a 4-digit number, and %C as
year/100 in a [00-99] range, they both crap out with years under 1000,
using respectively 3 and 1 digits.
This would be typically task for a width modifier (e.g. %4Y, or %2C),
but that was conversely found to break NixOS on Darwin.
Since the existing libc bugs paint us to a corner, detect an
appropriate modifier at build time to get a 4-digit year to get true
ISO 8601 in our supported [0001-9999] year range.
Closes: https://gitlab.gnome.org/GNOME/tracker/-/issues/402
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In case of error reading from the input stream, we would
propagate the error through the GTask and break, falling
through paths that also try to return and free the task.
Handle the task entirely at the end of the function, based
on the return value. We still need to close the input stream
and soup message in any case.
CID: #1517496
|
| |
| |
| |
| |
| |
| |
| |
| | |
In some circumstances we may pass -1 as len to g_strndup(), that
does not follow the "-1 means strlen()" convention. Do this
ourselves.
CIDs: #1530151, #1530152
|
|/
|
|
|
|
| |
These might get to happen in the right circumstances, from the looks of
it. Possibly fixes https://retrace.fedoraproject.org/faf/reports/688192/
and similar automated reports.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 944988326 attempted made finished batches cheap to keep
in memory, for languages where we don't have full control of
object lifetime (e.g. GJS).
This however broke tracker-miner-fs-3 handling of failures,
since that tries to peek at TrackerResources that were already
disposed by the TrackerBatch being cleared of content, in order
to retry, or report for `tracker3 status`.
In order to fix that and keep the improvement for the common
case (i.e. success), only clear the TrackerBatch contents if
the operation finished successfully.
Fixes: 944988326 ("libtracker-sparql/direct: Prune content of already executed batches")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit da9eb9a07c hid the internal FTS syntax as an implementation
detail, but it did so by making the full search string a single term,
so multiple input words had to also appear consecutively in the searched
text to be considered a match.
Bring back the flexibility in order/distance of the looked up words
by using a SQLite helper function to split FTS search terms. This
still results in the FTS syntax being hidden away, but splits the
input words so that each becomes its own search term.
Fixes: da9eb9a07c ("libtracker-data: Do not expose FTS5 syntax through fts:match")
|
|
|
|
|
|
|
| |
This function splits the search terms, and surrounds each of them with
double quotes so they are taken as individual literal strings to be
matched, quotes explicitly present in the search string are observed
and handled as a single search term, and implicitly closed in unfinished.
|
|\
| |
| |
| |
| | |
Plug some leaks
See merge request https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/582
|
| |
| |
| |
| |
| | |
When juggling with both update/select errors, we might be leaking one if
the latter call succeeded.
|
| |
| |
| |
| |
| | |
The async process takes a ref on the hashtable, so dispose our own
reference here.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The module lookup is currently based to the top builddir, which
might differ is Tracker is being built as a subproject. Make
it dependent on the current build dir (i.e. the directory the
module will be built to), so it works also on those situations.
Fixes: a4f9885a15d ("libtracker-common: Convert unicode parser to a GModule")
|
|\ \
| | |
| | |
| | |
| | | |
Migrate docs to gi-docgen (Take 2)
See merge request https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/580
|
| | |
| | |
| | |
| | |
| | |
| | | |
Port references and links to the gi-docgen format, and while at
it flesh out some more documentation and adjust formatting to
look better with the gi-docgen templates.
|
| | |
| | |
| | |
| | | |
This is required for correct introspection of our error domain.
|
| | |
| | |
| | |
| | |
| | | |
The documentation of g_dbus_error_register_error_domain() says we
should not use one.
|
|\ \ \
| |_|/
|/| |
| | |
| | |
| | |
| | | |
Make unicode library a module
Closes #396
See merge request https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/581
|
| | |
| | |
| | |
| | |
| | |
| | | |
This was broken and untested for very long, so it accumulated some
compiler warnings. This module is still on the hook and makes some
tests fail, fix these warnings anyway.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These are big and hairy dependencies, probably unwanted if anybody
wishes dbus connections but not local ones. Making them a GModule means
they are only loaded when strictly needed.
Closes: https://gitlab.gnome.org/GNOME/tracker/-/issues/396
|
| | |
| | |
| | |
| | |
| | | |
This is only created to give it to the parser, have it created from there
and detach TrackerLanguage from the rest of the code.
|
| | |
| | |
| | |
| | | |
This somewhat pointless boilerplate, get rid of it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Long long ago, this was an integration point since the Maemo platform
(I thought I'd never write that in 2023) had some infrastructure to
allow on-the-fly locale changes.
This is long long gone, and nowadays it's just a setlocale() wrapper
with a recursive lock that does nothing since all MT-unsafety of this
function comes from the global environment.
We can just setlocale() directly to query the locale details, with
pretty much all the same guarantees.
|
| | |
| | |
| | |
| | |
| | | |
Even if unset/C, it's a locale change that we register and honor
in consequence, it's not Tracker library's place to complain.
|
| | |
| | |
| | |
| | |
| | | |
The HAVE_LIBICU/LIBUNISTRING defines should not be needed for
anything now.
|
| | |
| | |
| | |
| | |
| | | |
Move these implementations together with the libicu/libunistring
implementations.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This code pretty much boils down to g_utf8_collate(), and is
in practice unused since there's always a libicu or libunistring
implementation available.
It would be nice to consolidate things into glib, but this deserves
its own performance analysis with the other options.
|
| | |
| | |
| | |
| | |
| | | |
Have the helpers defined together with the TrackerParser, so we don't
drag details about the unicode library to other parts of the code.
|
| |/
| |
| |
| |
| |
| | |
This function is only defined if the libicu-based text parser
is enabled, but does not belong there. Move it out, and fix
build when enabling libunistring for unicode management.
|
| |
| |
| |
| |
| |
| |
| |
| | |
These sort by task priority, but all inserted tasks get the
same default priority. We can just rely on the default/implicit
thread pool order, as that is what will happen anyways.
Spotted during investigation of the previous commit.
|
| |
| |
| |
| |
| |
| |
| |
| | |
There were a couple of GVariant leaks, in the handling of
DBus replies and TrackerSparqlStatement parameter handling.
Shuffle the variant floating reference ownership of parameters
so it's "owned" by the hash table, and not picked by the
first GVariantBuilder.
|
| |
| |
| |
| |
| | |
If a parsing error is raised, the array holding the state stack
for errors is being leaked.
|
| |
| |
| |
| |
| | |
Commit 38ec817c81 made TrackerSparql keep a reference to the
literals array, but forgot to unref it.
|
| |
| |
| |
| |
| | |
The string was mistakenly doubly allocated when dealing with
multi-valued properties.
|
|/
|
|
|
| |
The GVariants being extracted during iteration were being
leaked.
|
|
|
|
|
| |
We have 2 nested loops here, but we should break of them all.
Avoids possibly continuing and/or rewriting the already set GError.
|
|
|
|
|
|
| |
This is a single API entrypoint that may create either select or update
statements. Make it handle properly both by falling back. If the SPARQL was
not parsed by either, an error is picked and raised.
|
|
|
|
|
|
|
|
|
|
|
| |
We used to error out on parsing errors on first execution. Make this
propagated early, so that it is possible to know at TrackerSparqlStatement
creation time whether parsing was successful or not.
This typically didn't matter since statements could only be used with
select queries, and erroring out on first tracker_sparql_cursor_next()
is alright. But now statements are used for both updates and selects,
possibly from the same entrypoint, so it's better to error out early.
|
|
|
|
|
|
|
|
|
| |
As the last nco:phoneNumber FTS property removal shown, we do
seem to be missing the ontology update of the FTS property (i.e.
modifying or removing nrl:fulltextIndexed).
Handle that, so that we are not left with the stale property
value, possibly confusing things.
|
|
|
|
|
|
|
|
|
|
| |
This debug flag forces a FTS integrity check after every set of FTS
updates, and raises an error if the integrity check did fail. This
is a more proactive (and expensive) approach to finding out FTS index
corruptions.
In order to make this helpful right away, toggle this flag on for
our own test suite, so that CI may catch any remaining/popping issues.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Right now the handling of those is somewhat inconsistent, we
loudly warn, but simply return FALSE from our stmt_step() function
without setting an error. Fortunately, the most common reason for
those errors has been the soft corruption resulting from FTS
index corruption, so continuing despite the error was alright.
Propagate these error situations properly through a new
TRACKER_SPARQL_ERROR_CORRUPT error code, so that callers can
fail, rollback, or otherwise react upon.
|
|
|
|
|
|
| |
Extend the integrity check so it covers FTS index integrity in all
graph databases. If FTS is still corrupt after rebuild, an error
will be indirectly risen.
|
|
|
|
|
|
|
|
|
| |
We will want to handle integrity in a way that is dependent of
database structure and other things handled by the upper layers,
in fact we already do.
Add a TrackerDBManager::integrity-check signal, that TrackerDataManager
connects to, and move the basic database structure check there.
|