Skip to content

Commit e9d731b

Browse files
authored
RSDK-12421 - Remove remote_path and local_name (#437)
1 parent 04d4c4d commit e9d731b

File tree

4 files changed

+2
-16
lines changed

4 files changed

+2
-16
lines changed

lib/src/resource/base.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ class Subtype {
5454
..namespace = namespace
5555
..type = resourceType
5656
..subtype = resourceSubtype
57-
..remotePath.addAll(name.split(':')..removeLast())
58-
..name = name
59-
..localName = name.split(':').last;
57+
..name = name;
6058
}
6159

6260
@override

lib/src/resource/manager.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ class ResourceManager {
1515
if (resources.containsKey(name)) {
1616
throw DuplicateResourceException(name);
1717
}
18-
final rnWithoutRemote = name.deepCopy()
19-
..remotePath.clear()
20-
..name = name.localName;
18+
final rnWithoutRemote = name.deepCopy()..name = name.name.split(':').last;
2119
final names = _resourceNamesWithoutRemotes[rnWithoutRemote] ?? [];
2220
names.add(name);
2321
_resourceNamesWithoutRemotes[rnWithoutRemote] = names;

lib/src/robot/client.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ class RobotClient {
115115
Future<void> refresh() async {
116116
final rpb.ResourceNamesResponse response = await _client.resourceNames(rpb.ResourceNamesRequest());
117117
final responseNames = response.resources.map((rn) {
118-
if (rn.remotePath.isEmpty) {
119-
rn.remotePath.addAll(rn.name.split(':')..removeLast());
120-
}
121-
if (rn.localName.isEmpty) {
122-
rn.localName = rn.name.split(':').last;
123-
}
124118
return rn;
125119
});
126120
if (setEquals(responseNames.toSet(), resourceNames.toSet())) {

test/unit_test/resource/base_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ void main() {
1010
expect(localRN.namespace, Sensor.subtype.namespace);
1111
expect(localRN.type, Sensor.subtype.resourceType);
1212
expect(localRN.subtype, Sensor.subtype.resourceSubtype);
13-
expect(localRN.remotePath, []);
1413
expect(localRN.name, localName);
15-
expect(localRN.localName, localName);
1614

1715
// Remote
1816
final remoteName = 'my-sensor';
@@ -22,9 +20,7 @@ void main() {
2220
expect(remoteRN.namespace, Sensor.subtype.namespace);
2321
expect(remoteRN.type, Sensor.subtype.resourceType);
2422
expect(remoteRN.subtype, Sensor.subtype.resourceSubtype);
25-
expect(remoteRN.remotePath, remotePath.split(':'));
2623
expect(remoteRN.name, fullRemoteName);
27-
expect(remoteRN.localName, remoteName);
2824
});
2925
});
3026
}

0 commit comments

Comments
 (0)