first_page

studio status report: 2023-10

month 10 of 2023 was about finding foundational bugs πŸ› in Songhay.Player.ProgressiveAudio (and finally using Redis Cache)

No funny banter this month 😐 Issues #13 and #14 are currently holding up the release of the b-roll audio player. These challenges have emerged in a month that looks like this:

Obsidian Graph View

The major progress of this month was day-job related: I architected an app feature requiring Azure Cache for Redis. This work bled into weekends 😡 but was well worth the desired accomplishment! Selected notes below should touch upon this grueling journey:

[[Azure Cache for Redis]]: IDistributedCache does not support SCAN and MGET but is still needed

The following table summarizes the [[Redis]] commands the #day-job needs:

[[Redis]] command IDC method ICM/ID/IS method
GET
[πŸ“– docs ]
GetStringAsync
[πŸ“– docs ]
StringGetAsync(string)
[πŸ”— GitHub ]
DEL1
[πŸ“– docs ]
RemoveAsync
[πŸ“– docs ]
[πŸ”— GitHub ]
KeyDeleteAsync
[πŸ”— GitHub ]
SET
[πŸ“– docs ]
SetStringAsync
[πŸ“– docs ]
StringSetAsync
[πŸ”— GitHub ]
MGET
[πŸ“– docs ]
🚫 StringGetAsync(string[])
[πŸ”— GitHub ]
SCAN
[πŸ“– docs ]
🚫 KeysAsync
[πŸ”— GitHub ]
HGET
[πŸ“– docs ]
🚫 HashGetAsync
[πŸ”— GitHub ]

1There is no MDEL command as the DEL command supports multiple optional keys.

GetStringAsync and SetStringAsync have an advantage over the ID equivalents because [[Microsoft]] abstracts away the ceremony around setting expiration dates.

welcome to Friday the 13th πŸ•Έ: when IDistributedCache writes a string into [[Redis]], it is actually writing a hash 😠 #day-job

In order to support [[Redis]] cache entry expiration ❓ [[Microsoft]] is entering hashes on our behalf when we expect strings to be written! This means that:

[!warning] MGET cannot be used with IDistributedCache [[Redis]] cache entries because these entries are hashes. There are no [[Redis]] commands that are the hash-equivalent of MGET.

It is an error to assume that HMGET [πŸ“– docs ] is the equivalent of MGET. The hash getters of [[Redis]] are more concerned with returning multiple values from a single hash entry. I see no concern for returning an array of arrays: multiple hash values.

[[Songhay Player - Progressive Audio (Fβ™―)]]: progressive audio features are actually needed for the progressive audio player 😐

The previous progressive audio player leveraged audio5js [πŸ”— GitHub ] which correctly uses the canplay event [πŸ”— GitHub ] while my design currently does notβ€”not even incorrectly 😐

[!error] Currently the [[Songhay Player - Progressive Audio (Fβ™―)]] does not use the canPlay event [πŸ“– docs ] which means large files that are not sufficiently downloaded fail to play (without any console error messages).

These are the minimum features needed based on the canPlay event:

  • [x] the player controls should be disabled until the canPlay event fires or HTMLMediaElement.readyState is greater than 2 (HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA [πŸ“– docs ])
  • [x] when a playlist item is clicked the player controls should be disabled and the canPlay event should fire again and/or HTMLMediaElement.readyState is checked again
  • [x] the playlist should be disabled until the current track canPlay and/or HTMLMediaElement.readyState is greater than 2
  • [x] data should be written to the console to track states (the loadstart event [πŸ“– docs ] and the loadedmetadata event [πŸ“– docs ] should be tracked here)

Issue #14 is open for this.

design critique

Because I decided 😐 to use a fucked up polling strategy in ProgressiveAudioUtility.startPlayAnimation I allowed myself to not care about HTMLMediaElement.readyState. I now consider this decision insane.

  • [x] #14 add PlayerAudioLoadStartEvent and PlayerAudioCanPlayEvent messages πŸ”¨πŸŽ
  • [x] #14 add ProgressiveAudioModel.canPlay boolean πŸ”¨
  • [x] #14 remove the polling strategy in ProgressiveAudioUtility.startPlayAnimation πŸ”¨
  • [x] #14 remove ProgressiveAudioUtility.toggleElementEnabled πŸ”¨πŸ”₯
  • [x] #14 use ProgressiveAudioModel.canPlay boolean to drive the application of pointer-events: none for the playlist πŸ”¨πŸŽπŸ’„

three new [[Jupyter]] notebooks to study [[JavaScript]] #day-job

  1. [[dotnet|.NET]]: IDictionary<TKey,TValue> and JavaScript’s Map [πŸ”— GitHub ]
  2. JavaScript date math [πŸ”— GitHub ]
  3. [[jQuery]]: .serializeArray and FormData

β€œHow to list all routes in an [[ASP.NET]] Core application” #day-job

https://www.meziantou.net/list-all-routes-in-an-asp-net-core-application.htm

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.UseRouting();

if (app.Environment.IsDevelopment())
{
    app.MapGet("/debug/routes", (IEnumerable<EndpointDataSource> endpointSources) =>
        string.Join("\n", endpointSources.SelectMany(source => source.Endpoints)));
}

app.Run();

the [[Daniel Ward]] presentation on [[xUnit]]

xUnit Expanded – Better Testing With xUnit by Daniel Ward

xUnit Expanded – Better Testing With xUnit by Daniel Ward

The big news from this [[Daniel Ward]] presentation is the surprise about [[xUnit]] collections:

How does xUnit.net decide which tests can run against each other in parallel? It uses a concept called test collections to make that decision.

By default, each test class is a unique test collection. Tests within the same test class will not run in parallel against each other.

β€”https://xunit.net/docs/running-tests-in-parallel

Also see β€œShared Context between Tests” πŸ“–

[!warning] The [[xUnit]] documentation makes no mention of ordered testing.

[[Daniel Ward]] made no mention of ordered testing which may suggest that ordered tests are frowned upon or considered obsolete in the context of mocking and using containers with [[Respawn]].

I need to revisit this [[Daniel Ward]] video again for more detail #to-do

[[Microsoft]]: β€œWilliam A. Adams, Software Engineer, DEI Innovator, and Philanthropist”

William A. Adams, Software Engineer, DEI Innovator, and Philanthropist

William A. Adams, Software Engineer, DEI Innovator, and Philanthropist

sketching out development projects

The current, unfinished public projects on GitHub:

  • replace the Angular app in http://kintespace.com/player.html with a Bolero app 🚜πŸ”₯
  • finish the β€œSonghayCore πŸ“¦βœ¨ release 6.0.5” project
  • start the β€œSonghay.Publications.Models 6.0.0” πŸ“¦πŸš€ project

The proposed project items:

  • add kintΓ© space presentations support to Songhay.Player.YouTube πŸ”¨ 🚜✨
  • generate Publication indices from SQLite for Songhay.Publications.KinteSpace
  • generate a new repo with proposed name, Songhay.Modules.Bolero.Index ✨🚧 and add a GitHub Project
  • switch Studio from Material Design to Bulma πŸ’„ ➑️ πŸ’„βœ¨

https://github.com/BryanWilhite/