[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for repoGet request #6273

Merged
merged 56 commits into from
Jun 16, 2022
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
db50631
WIP
maneesht May 13, 2022
46cd378
Simulate add/remove event registration in repoGetValue
jmwski May 13, 2022
c334171
Fixed duplicate onValue calls
maneesht May 17, 2022
f7298df
Updated test file
maneesht May 18, 2022
00a5907
Updated integration test to include get
maneesht May 19, 2022
3ea9604
Reduced timeout for tests
maneesht May 20, 2022
9520427
Removed unnecessary imports
maneesht May 20, 2022
e7dd651
Added back imports
maneesht May 20, 2022
f7ed576
Removed snapshot param
maneesht May 20, 2022
98c6e34
Addressed comments
maneesht May 23, 2022
43f1f8a
Fixed test
maneesht May 23, 2022
9394170
Removed only
maneesht May 23, 2022
2f82052
Removed unnecessary import
maneesht May 23, 2022
c976987
Updated test
maneesht May 23, 2022
fc4cf5c
Added extra test
maneesht May 24, 2022
7c31ece
Merge branch 'master' into fix-get-cache
maneesht May 25, 2022
3959cf3
Fixed formatting
maneesht May 25, 2022
536e103
Create rotten-tables-brush.md
maneesht May 25, 2022
3812a33
Added documentation
maneesht May 25, 2022
a8d8ea6
Passed formatting
maneesht May 25, 2022
7de3c12
Merge remote-tracking branch 'origin/master' into fix-get-cache
maneesht May 26, 2022
766f46d
Addressed comments
maneesht May 26, 2022
04356e4
WIP
maneesht May 31, 2022
a467055
Used unique id instead of foo
maneesht May 31, 2022
6145b2b
Used exactCount instead of Count for accumulator
maneesht Jun 1, 2022
788aaa0
Removed only
maneesht Jun 1, 2022
51d57a2
Reformatted
maneesht Jun 1, 2022
41a7303
Removed get wip
maneesht Jun 2, 2022
a58bb33
Got minimal repro
maneesht Jun 2, 2022
5d41ce0
Got minimal repro
maneesht Jun 2, 2022
bdfd40b
Fixed race condition issue
maneesht Jun 2, 2022
4ca2289
Updated tests
maneesht Jun 2, 2022
b52f468
Updated yarn lock file
maneesht Jun 3, 2022
27f9ea1
Updated module type
maneesht Jun 3, 2022
065dab0
Added comment
maneesht Jun 3, 2022
d5fef45
Merge remote-tracking branch 'origin/master' into fix-get-cache
maneesht Jun 3, 2022
74fe5e8
Removed unnecessary code
maneesht Jun 3, 2022
5858b86
Merge remote-tracking branch 'origin/master' into fix-get-cache
maneesht Jun 6, 2022
be41979
Removed unnecessary comment
maneesht Jun 6, 2022
f320a93
Removed unused imports
maneesht Jun 6, 2022
c4f8ff7
Updated test to remove redundant assertion
maneesht Jun 6, 2022
1dc798c
Moved query check
maneesht Jun 8, 2022
42e38f6
Updated tests to include example queries
maneesht Jun 8, 2022
b4c7f28
Fixed formatting
maneesht Jun 8, 2022
5559921
Added suggestions
maneesht Jun 8, 2022
52fcf72
Fixed formatting
maneesht Jun 8, 2022
c553405
Replaced let with const
maneesht Jun 8, 2022
a7e5865
Fixed tests
maneesht Jun 9, 2022
98845d1
Fixed test
maneesht Jun 9, 2022
69feeb7
Fixed formatting
maneesht Jun 9, 2022
60f9da0
Fixed tests
maneesht Jun 15, 2022
6f39fef
Removed comments
maneesht Jun 15, 2022
57a8db5
Removed version of uuid
maneesht Jun 15, 2022
31a747e
Added a new line
maneesht Jun 15, 2022
bd23960
Addressed comments
maneesht Jun 16, 2022
7e09d4b
Fixed formatting
maneesht Jun 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simulate add/remove event registration in repoGetValue
  • Loading branch information
jmwski committed May 13, 2022
commit 46cd3781b4e34fb5d4171c797152789dd220ce98
17 changes: 13 additions & 4 deletions packages/database/src/core/Repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
statsManagerGetOrCreateReporter
} from './stats/StatsManager';
import { StatsReporter, statsReporterIncludeStat } from './stats/StatsReporter';
import { syncPointGetView, syncPointViewExistsForQuery, syncPointViewForQuery } from './SyncPoint';
import { syncPointGetView, syncPointIsEmpty, syncPointViewExistsForQuery, syncPointViewForQuery } from './SyncPoint';
import {
createNewTag,
SyncTree,
Expand Down Expand Up @@ -483,9 +483,15 @@ export function repoGetValue(repo: Repo, query: QueryContext): Promise<Node> {
);
eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events);
jmwski marked this conversation as resolved.
Show resolved Hide resolved
} else {
// Otherwise, only overwrite for query
console.log('query')
syncTreeAddToPath(query, repo.serverSyncTree_);
// Simulate `syncTreeAddEventRegistration` without events/listener setup.
jmwski marked this conversation as resolved.
Show resolved Hide resolved
// TODO: We can probably extract this.
const { syncPoint, serverCache, writesCache, serverCacheComplete, viewAlreadyExists, foundAncestorDefaultView } = syncTreeAddToPath(query, repo.serverSyncTree_);
if (!viewAlreadyExists && !foundAncestorDefaultView) {
const view = syncPointGetView(syncPoint, query, writesCache, serverCache, serverCacheComplete);
if (!syncPoint.views.has(query._queryIdentifier)) {
syncPoint.views.set(query._queryIdentifier, view);
}
}
const tag = syncTreeTagForQuery_(repo.serverSyncTree_, query);
jmwski marked this conversation as resolved.
Show resolved Hide resolved
const events = syncTreeApplyTaggedQueryOverwrite(
repo.serverSyncTree_,
Expand All @@ -494,6 +500,9 @@ export function repoGetValue(repo: Repo, query: QueryContext): Promise<Node> {
tag
);
eventQueueRaiseEventsAtPath(repo.eventQueue_, query._path, events);
// Call `syncTreeRemoveEventRegistration` with a null event registration, since there is none.
const cancels = syncTreeRemoveEventRegistration(repo.serverSyncTree_, query, null)
assert(cancels.length == 0, "unexpected cancel events in repoGetValue");
}
return Promise.resolve(node);
},
Expand Down