-
Type: Bug
-
Resolution: Incomplete
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
What happened?
I used SubscribeForNotifications with IRealmCollection. After packaging the app into an MSIX for installation, I didn't receive any notifications when adding a new record. However, during local debugging, I could receive notifications.
Repro steps
- Implement SubscribeForNotifications on ViewModel init.
- Add a new record.
- SubscribeForNotifications didn't receive any notifications.
Version
8.0
What Atlas Services are you using?
Local Database only
What type of application is this?
Other
Client OS and version
Windows 10 22H2 build 19045.4291
Code snippets
DataService.cs
public class DataService { public static DataService Instance { get; } = new DataService(); private readonly Realm LocalRealm; public IRealmCollection<Device> DeviceList { get; } public async Task<Device> AddDevice(Device device) { return await LocalRealm.WriteAsync(() => { return LocalRealm.Add(device, true); }); } }
ViewModel.cs
public partial class DeviceListViewModel : ObservableObject { public ObservableCollection<Models.Device> DeviceList { get; } = []; private IDisposable deviceListNotifyToken; public DeviceListViewModel() { deviceListNotifyToken = DataService.Instance.DeviceList.SubscribeForNotifications((list, changeSet) => { if (changeSet != null) { foreach (var idx in changeSet.InsertedIndices) DeviceList.Insert(idx, list[idx]); foreach (var idx in changeSet.ModifiedIndices) { var item = list[idx]; DeviceList.RemoveAt(idx); DeviceList.Insert(idx, item); } foreach (var idx in changeSet.DeletedIndices) DeviceList.RemoveAt(idx); } OnPropertyChanged(); }); } }
Stacktrace of the exception/crash you're getting
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
No crash.
Relevant log output
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
No log.