Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions aw-server/src/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ pub mod android {
Err(err) => return create_error_object(&env, err.to_string()),
};

// Hardcoded bucket ID for testing
let bid_android = "aw-watcher-android-test".to_string();
// Hardcoded bucket ID
let bid_android = "aw-watcher-android".to_string();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unmigrated Buckets Stop Querying

When androidQuery runs before migrateWatcherAndroidBucketNames has renamed existing aw-watcher-android-test... buckets, the new aw-watcher-android filter no longer matches the only stored Android watcher bucket. That makes the JNI query return an error JSON instead of the user's events until the separate migration entry point has run successfully.


// Get classes from server settings via HTTP API
let classes = match AwClient::new("127.0.0.1", 5600, "aw-android-query") {
Expand Down
19 changes: 14 additions & 5 deletions aw-transform/src/find_bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,27 @@ pub fn find_bucket<'a>(
hostname_filter: &Option<String>,
buckets: impl IntoIterator<Item = &'a Bucket>,
) -> Option<String> {
let mut prefix_match = None;
for bucket in buckets {
if bucket.id.starts_with(bucket_filter) {
if let Some(hostname) = hostname_filter {
if hostname == &bucket.hostname {
let hostname_matches = match hostname_filter {
Some(hostname) => hostname == &bucket.hostname,
None => true,
};

if hostname_matches {
if bucket.id == bucket_filter {
// Exact match, return immediately
return Some(bucket.id.to_string());
}
} else {
return Some(bucket.id.to_string());
if prefix_match.is_none() {
// Save the first prefix match in case we don't find an exact match
prefix_match = Some(bucket.id.to_string());
}
}
}
}
None
prefix_match
}

#[cfg(test)]
Expand Down
Loading