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

Fixes to Decode Event filtering #1295

Conversation

apankowski
Copy link
Contributor

@apankowski apankowski commented Jul 24, 2022

This is my attempt at fixing current implementation of decode event filtering which has the following problems:

  1. Wrong layout with excessive space between button bar and decode event list view:
    image

  2. Current decode event filter set not covering all DecodeEventTypes - CALL was missing

  3. DecodeEventBuilder not honoring DecodeEventType set on it

  4. Decode event list ("Events" view) is not properly reversing list of events and filtering it using set filters when changing channels in "Now Playing" view - notice the ordering below before the fix. However, new events are added at the top.
    image

  5. Most of the DecodeEvents in the codebase do not have DecodeEventType set at all (so it's null). As a consequence they do not pass EventFilter.passes and by extension - they are not added to the "Events" list and do not receive updates (e.g. call duration). This is fixed by adding a new "Everything else" node in the filter tree which acts as a catch-all for all such events. An alternative would be to go over the whole codebase and make sure each created DecodeEvent has type specified.

Any remarks welcome 🙂

Edit: I see that #1099 is a follow-up to the #1098 that introduced event filtering. I think this PR could be an interim solution before #1099 gets merged (and fix issues that are not addressed by #1099)

Edit 2: I started adding some JUnit tests to verify the new behavior, following boy-scout approach. I plan to add tests for most of the changes in this PR.

Edit 3: I added tests following TDD and then adjusted implementation to adhere to the contract specified by the tests.

@Nokoa
Copy link
Contributor

Nokoa commented Aug 1, 2022

Does this also fix #1287 ?

@apankowski
Copy link
Contributor Author

@Nokoa I think it does. Description of #1287 sounds exactly like what I've observed for all decoder types I've tested this with (it's point (5) from this PR's description). This didn't include DMR specifically, but the affected code-paths apply to all decoder types. Feel free to check if it fixes it with your setup 🙂

@Nokoa
Copy link
Contributor

Nokoa commented Aug 1, 2022

At a first glance right now, it appears that DMR Events are appearing in real time. Thank you!

Copy link
Contributor Author

@apankowski apankowski left a comment

Choose a reason for hiding this comment

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

self review 🙂

@@ -40,7 +40,7 @@ public class DecodeEvent implements IDecodeEvent
private Protocol mProtocol;
private Integer mTimeslot;

public DecodeEvent(long start)
protected DecodeEvent(long start)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this constructor is only used by builders, hence it can be protected

@@ -332,4 +327,26 @@ public String toString()
}
return sb.toString();
}

@Override
public boolean equals(Object o) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

equals and hashCode are for tests

@@ -44,12 +44,12 @@ dependencies {

// JUnit Tests
testImplementation 'junit:junit:4.12'
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.0"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.7.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add vintage JUnit engine capable of handling JUnit 4 tests


import java.util.List;

public interface CommonFixtures {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will likely evolve into per-entity fixtures. for now it's enough to have a common support interface that can be mixed in to be able to construct basic building blocks with some default values

@GTR8000
Copy link

GTR8000 commented Aug 5, 2022

I tested this out a few minutes ago and noticed that the Events message filter now has the Everything Else selection, which all P25 events seem to now fall under. In other words, there's currently no filtering available, it's all or nothing. I do see that you mention this in your first post here, so it's a known issue.

Is there an estimated timeline for the events to get properly mapped back to their individual filter selections?

Thanks, appreciate the effort!

@apankowski
Copy link
Contributor Author

@GTR8000 part 2 of solving the problems is in #1099. The author had problems with rebasing (see thread in that PR) but with his permission I could help him and (if needed) take it over and finish. In that case I think a realistic timeline would be 4 weeks from now since it's holiday season. If the author doesn't let me finish it (lets me help him with rebasing) I cannot provide any timeline as it's then not really on me.

@apankowski apankowski changed the title Fix Decode Event filtering Fixes to Decode Event filtering Aug 5, 2022
@DSheirer
Copy link
Owner

Closing. Contents of this PR were merged under PR #1601

@DSheirer DSheirer closed this Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants