handle message errors in a typed way CORE-4515

Purpose of this is so the clients can respond more intelligently to message versions from the future. We tag each message error with a type to indicate what kind of error triggered it.
Also, build in some future proofing to handle versions in the future, and (right now), whether we should surface to clients information about errors from them.

cc @patrickxb


Elementum wont even start

Im running windows 10 and latest elementum, version 0.48. With new version elementum wont even start. Here is full log: https://pastebin.com/EMJ1EtFM

Have you restarted Kodi after update? Enabled remote control?

Yes and i rebooted computer. Also firewall and virus program was disabled but no help.

Previous version was working for you? Or this is the first installation?

I used yesterday and worked fine. I think that new version updated today. Also windows installed updates yesterday when i shutdown computer but i dont know if that is issue. And its not first installation.

Can you try to delete ".torrent.bolt.db" file inside of C:\Users\Jesse\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.elementum\ directory.
Then restart. If it won't help - change download storage to Memory (not File). There is something that is broken, so we'd find where it happens.

Can you now do this:

return storage type to File
restart Kodi
wait for 30 seconds (about). open http://<IP_ADDRESS>:65520/debug/bundle (replace with IP of your Kodi).
wait for another 10-15 minutes and download log again
share both logs

While waiting - you can use Kodi, but not Elementum.
It looks like there is something with file storage. We'll see.

I test that tomorrow when i wakeup and i give log files.

hello, i am new with using your add on, however i have found a possible partial workaround for the issue, because the my kodi installation was performed through windows store, the installed kodi from windows store is "sandboxed" and shows different path and behavior as the pure installer (aka. exe downloaded from kodi.tv).
After checking the kodi.log located at: "C:\Users\myuser\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi", i notice this line:
DEBU  database     ▶ InitSqliteDB     Error migrating schema: unable to open database file
and following the comment "Can you try to delete ".torrent.bolt.db" file inside of C:\Users\Jesse\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.elementum\ directory.
Then restart. If it won't help - change download storage to Memory (not File). There is something that is broken, so we'd find where it happens." from elgatito,
i stated that maybe the path is not correctly set due to the windows app sandbox, and create the missing directories by hand, and restart kodi, after that the daemon starts and fill the folder with the data. But is seems to be that there are some missing items or folders, because the addon is still crashing, but the log file are showing more information than before this is an extract from my kodi.log file.
01:25:52.847 T:12616  NOTICE: [plugin.video.elementum] elementumd: starting elementumd 01:25:52.848 T:12616  NOTICE: [plugin.video.elementum] Kodi's JSON-RPC service is available, starting up... 01:25:52.848 T:12616  NOTICE: [plugin.video.elementum] Binary detection. Source: C:\Users\Raul\AppData\Roaming\Kodi\addons\plugin.video.elementum\resources\bin\windows_x64\elementum.exe, Destination: C:\Users\Raul\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.elementum\bin\windows_x64\elementum.exe 01:25:52.851 T:12616  NOTICE: [plugin.video.elementum] Deleting stale files set([]) 01:25:52.852 T:12616  NOTICE: [plugin.video.elementum] Binary detection: [ Source: C:\Users\Raul\AppData\Roaming\Kodi\addons\plugin.video.elementum\resources\bin\windows_x64\elementum.exe, Destination: C:\Users\Raul\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.elementum\bin\windows_x64\elementum.exe ] 01:25:52.852 T:12616  NOTICE: [plugin.video.elementum] Binary dir: C:\Users\Raul\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.elementum\bin\windows_x64, item: C:\Users\Raul\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.elementum\bin\windows_x64\elementum.exe 01:25:53.017 T:12616  NOTICE: [plugin.video.elementum] elementumd: start args: [u'C:\\Users\\Raul\\AppData\\Roaming\\Kodi\\userdata\\ADDON_~1\\PLUGIN~1.ELE\\bin\\WINDOW~1\\ELEMEN~1.EXE'], kw: {'startupinfo': <subprocess.STARTUPINFO instance at 0x10390AA8>, 'cwd': u'C:\\Users\\Raul\\AppData\\Roaming\\Kodi\\userdata\\ADDON_~1\\PLUGIN~1.ELE\\bin\\WINDOW~1', 'stderr': -2, 'stdout': -1} 01:25:54.381 T:12616  NOTICE: [plugin.video.elementum] INFO  main         ▶ main             Starting Elementum daemon 01:25:54.381 T:12616  NOTICE: [plugin.video.elementum] INFO  main         ▶ main             Version: 0.0.47 GoTorrent: f6ed514c Go: go1.10.2 01:25:54.383 T:12616  NOTICE: [plugin.video.elementum] INFO  config       ▶ Reload           Reloading configuration... 01:25:54.424 T:12616  NOTICE: [plugin.video.elementum] INFO  config       ▶ Reload           Using download path: C:\Users\Raul\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\userdata 01:25:54.435 T:12616  NOTICE: [plugin.video.elementum] INFO  config       ▶ Reload           Using library path: C:\Users\Raul\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\userdata 01:25:54.465 T:12616  NOTICE: [plugin.video.elementum] DEBU  config       ▶ Reload           Total system memory: 8.4 GB 01:25:54.465 T:12616  NOTICE: [plugin.video.elementum] DEBU  config       ▶ Reload           Automatically selected memory size: 419 MB 01:25:54.466 T:12616  NOTICE: [plugin.video.elementum] DEBU  config       ▶ Reload           Selected memory size (419 MB) is bigger than maximum for auto-select (210 MB), so we decrease memory size to maximum allowed: 210 MB 01:25:54.466 T:12616  NOTICE: [plugin.video.elementum] INFO  main         ▶ main             Addon: plugin.video.elementum v0.0.47 01:25:54.472 T:12616  NOTICE: [plugin.video.elementum] INFO  config       ▶ CheckBurst       Updating Kodi add-on repositories for Burst... 01:25:54.908 T:12616  NOTICE: [plugin.video.elementum] DEBU  database     ▶ InitSqliteDB     Updated database to version: 1 01:25:54.910 T:12616  NOTICE: [plugin.video.elementum] INFO  main         ▶ Migrate          Preparing for first run... 01:25:54.911 T:12616  NOTICE: [plugin.video.elementum] INFO  main         ▶ Migrate          Creating Elementum repository add-on... 01:25:54.912 T:12616  NOTICE: [plugin.video.elementum] ERRO  main         ▶ Migrate          Unable to create repository add-on: open C:\Users\Raul\AppData\Roaming\Kodi\addons\plugin.video.elementum\icon.png: El sistema no puede encontrar la ruta especificada. 01:25:54.912 T:12616  NOTICE: [plugin.video.elementum] INFO  bittorrent   ▶ configure        Configuring client... 01:25:54.914 T:12616  NOTICE: [plugin.video.elementum] INFO  bittorrent   ▶ configure        ListenIP=, ListenIPv6=, ListenPort=0, DisableIPv6=true 01:25:54.914 T:12616  NOTICE: [plugin.video.elementum] INFO  bittorrent   ▶ configure        UserAgent: Elementum/0.0.47, PeerID: -GT0001- 01:25:54.915 T:12616  NOTICE: [plugin.video.elementum] INFO  bittorrent   ▶ configure        DownloadStorage: Memory 01:25:54.915 T:12616  NOTICE: [plugin.video.elementum] DEBU  memory       ▶ NewMemoryStorage  Initializing memory storage of size: 210 MB 01:25:54.916 T:12616  NOTICE: [plugin.video.elementum] DEBU  bittorrent   ▶ configure        BitClient config: &torrent.Config{DataDir:"C:\\Users\\Raul\\AppData\\Local\\Packages\\XBMCFoundation.Kodi_4n2hpmxwrvr6p\\LocalCache\\Roaming\\Kodi\\userdata", ListenHost:(func(string) string)(0xcfde40), ListenPort:0, NoDefaultPortForwarding:false, DisableTrackers:false, DisablePEX:false, NoDHT:false, DhtStartingNodes:(dht.StartingNodesGetter)(0xab1de0), NoUpload:false, DisableAggressiveUpload:false, Seed:true, UploadRateLimiter:(*rate.Limiter)(0xc042213310), DownloadRateLimiter:(*rate.Limiter)(0xc0422132c0), PeerID:"-GT0001-CP7DV43MYYZT", DisableUTP:false, DisableTCP:false, DefaultStorage:(*memory.Storage)(0xc04220cf00), EncryptionPolicy:torrent.EncryptionPolicy{DisableEncryption:false, ForceEncryption:false, PreferNoEncryption:false}, ProxyURL:"", IPBlocklist:iplist.Ranger(nil), DisableIPv6:true, DisableIPv4:false, DisableIPv4Peers:false, Debug:false, HTTP:(*http.Client)(nil), HTTPUserAgent:"Elementum/0.0.47", ExtendedHandshakeClientVersion:"", Bep20:"-GT0001-", NominalDialTimeout:0, MinDialTimeout:0, EstablishedConnsPerTorrent:0, HalfOpenConnsPerTorrent:0, TorrentPeersHighWater:0, TorrentPeersLowWater:0, HandshakesTimeout:0, PublicIp4:net.IP(nil), PublicIp6:net.IP(nil)} 01:25:54.916 T:12616  NOTICE: [plugin.video.elementum] INFO  bittorrent   ▶ configure        Client created successfully 01:25:54.917 T:12616  NOTICE: [plugin.video.elementum] DEBU  bittorrent   ▶ configure        Client listening on tcp: <IP_ADDRESS>:63389 01:25:54.917 T:12616  NOTICE: [plugin.video.elementum] DEBU  bittorrent   ▶ configure        Client listening on udp: <IP_ADDRESS>:63389 01:25:54.917 T:12616  NOTICE: [plugin.video.elementum] INFO  tmdb         ▶ CheckAPIKey      Checking TMDB API key... 01:25:54.926 T:12616  NOTICE: [plugin.video.elementum] error looking up "router.silotis.us:6881": lookup router.silotis.us: no such host 01:25:55.319 T:12616  NOTICE: [plugin.video.elementum] NOTI  tmdb         ▶ CheckAPIKey      TMDB API key check passed, using 29a551a... 01:25:55.324 T:12616  NOTICE: [plugin.video.elementum] panic: html/template: pattern matches no files: C:\Users\Raul\AppData\Roaming\Kodi\addons\plugin.video.elementum\resources\web*.html01:25:55.324 T:12616  NOTICE: [plugin.video.elementum] 01:25:55.325 T:12616  NOTICE: [plugin.video.elementum] goroutine 1 [running]: 01:25:55.325 T:12616  NOTICE: [plugin.video.elementum] html/template.Must(0x0, 0x1133d60, 0xc04227bc90, 0x0) 01:25:55.325 T:12616  NOTICE: [plugin.video.elementum] 	/usr/local/go/src/html/template/template.go:372 +0x5b 01:25:55.325 T:12616  NOTICE: [plugin.video.elementum] github.com/gin-gonic/gin.(*Engine).LoadHTMLGlob(0xc0420b67e0, 0xc04249e3c0, 0x55) 01:25:55.326 T:12616  NOTICE: [plugin.video.elementum] 	/ext-go/2/src/github.com/gin-gonic/gin/gin.go:181 +0x41a 01:25:55.326 T:12616  NOTICE: [plugin.video.elementum] github.com/elgatito/elementum/api.Routes(0xc042203110, 0xc04227bbf0) 01:25:55.326 T:12616  NOTICE: [plugin.video.elementum] 	/ext-go/1/src/github.com/elgatito/elementum/api/routes.go:32 +0x43d 01:25:55.327 T:12616  NOTICE: [plugin.video.elementum] main.main() 01:25:55.327 T:12616  NOTICE: [plugin.video.elementum] 	/ext-go/1/src/github.com/elgatito/elementum/main.go:138 +0x9f3 01:25:55.334 T:12616  NOTICE: [plugin.video.elementum] 01:25:55.343 T:12616  NOTICE: Previous line repeats 39 times. 01:25:55.343 T:12616  NOTICE: [plugin.video.elementum] System information: windows_x64 10 01:25:55.343 T:12616  NOTICE: [plugin.video.elementum] Kodi build version: 17.6 Git:20171114-a9a7a20 01:25:55.343 T:12616  NOTICE: [plugin.video.elementum] OS type: Windows 01:25:55.343 T:12616  NOTICE: [plugin.video.elementum] uname: ('Windows', 'Elitebook-2540p', '10', '10.0.16299', 'AMD64', 'Intel64 Family 6 Model 37 Stepping 5, GenuineIntel')
maybe this would be a good approach to solve the issue,

@tortaman  this is not related to current issue. You can raise a separate issue regarding running in a Windows Store's Kodi. There were reports earlier, but I don't have a test environment, so you can raise an issue to track it.
PS: adding directories will work only for manual way, sandboxing idea is to disallow all activities outside of a sandbox, so the issue is not about directories, but about getting right directory, created by Store and used by Kodi.

i have solved the other issues by copying the entire folder located at C:\Users\myuser\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\addons\plugin.video.elementum"
"C:\Users\myuser\AppData\Roaming\Kodi\addons\plugin.video.elementum"
now the plugin don't crash but still cannot use it because continues asking me to restart kodi undefinely
kodi log extract:

01:49:35.052

T:13700   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.elementum/
01:49:35.053 T:13700   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.elementum/) failed

@tortaman again, your issue is not connected to the one, reported here.

I tested that but when i replace ip with kodi ip, it says cannot connect.

@Jezze83 sorry, the port is 65220, not 65520

Still not working. I think problem is that because whole daemon wont even start.

Pff... You are right :)
Can you try to change the download path (to any other directory) with the File storage.
I will add few more messages to the log in the next version to see where it hangs.

Changed download path but didnt help.

@elgatito sorry i had no idea that you have answer my comment before, maybe you did it at the same time as my 2nd comment, I will open a new thread with the issue, because now i activated the debug option 2 in kodi and now the kodi.log is more verbose than before,

@Jezze83 an you replace the binary located at C:\Users\Jesse\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.elementum\bin\windows_x64\elementum.exe with this one
archive.zip
There should be a little more log messages.

Replaced and daemon wont start. Here is full log: https://pastebin.com/UJFA70xK

What both paths? What is second path?

Find elementum.exe

I copied to both paths but still not working.

It should not work. It should print more log messages.

Kodi UWP? Installed from magasine?

I am also facing the same problem suddenly on my pi3 (Kodi Leia), running osmc (4.14.34-2-osmc),
Log: https://pastebin.com/zPBaMwU8
but also on my PC running win10x64 (Kodi 17.6)
Log: https://pastebin.com/1g7MZpvD

@Sandbird  you have another issue.
1 case: Your database file is corrupted. remove library.db and cache.db files (in your plugin.video.elementum directory).
2 case: provide a full kodi.log in debug mode https://kodi.wiki/view/Log_file/Easy

@Sandbird  btw, can you send me the library.db and cache.db files before removing? I will try to avoid this problem in the future.

@elgatito btw, is it possible import somehow with elementum all tv shows and movies from trakt to tv shows and movies library so i can watch from there through elementum?

@elgatito , are you sure ? because i deleted everything except the app.db and the error still shows up.
Latest log when i clicked the app: https://pastebin.com/fF0Y3h6k
Here are the files you requested. The big one, is obviously what you want, but the small cache file is the new one that it created but still gives the same error.
https://1drv.ms/u/s!AmE8PmxBNnNajA51fA3PouuoBmHV

@Jezze83 of course, if you authorize trakt in Elementum settings - it will import everything from collections and userlists.

@Sandbird you should not post part logs, there is no information. Only full logs.

@Sandbird I cannot extract the archive, says it;s broken.

@elgatito i mean to there as you can see on first two pictures, its empty now. In elementum addon i can see from my trakt my lists.

@elgatito I'll do the debug log thingy and post back. hmmm its a winrar file, but with no compression so it should be fine with normal windows extract tool..

@Jezze83 have you authorized Elementum to use your Trakt account?

@elgatito yes and it mark as watched to trakt when i watch episode or movie with elementum addon. But it wont import my trakt library to my main library at kodi. What kinda settings i need put to elementum so it import to my main tv shows and movies library?

@Jezze83 you can open Elementum settings, Trakt tab, run Syncronization and then post kodi.log.

@elgatito Full debug log : https://pastebin.com/i8SNfhCk
I waited 2min before i click the Elementum app, (it didnt autostart btw), and then when i clicked it, the same error occured.

@Sandbird Now it looks same error as issue-starter. Your application is not starting. Try to change storage to memory and try again.

@elgatito , yup, switching to memory worked!
I guess the file option has some bug. Would the memory part work well for the pi3 though ?
For the PC is fine, although sometimes it is nice to have the torrent as a file in order see it again in the future.

@Sandbird fine with RPi3, people use it. However I'd limit memory usage to 40-50mb at most.

Awesome, thanks.

@Jezze83  can you try this binary with File storage?
archive.zip

Now it works with that file. Are these correct settings for import to kodi library:

@Jezze83 so with the custom binary, that i've sent here, you can use File storage fine? And with 0.0.49 it does not work with File storage?
You can use default settings for Trakt sync, just authorized elementum in Trakt.

I tested first with 0.49 but it didnt work. 0.49 with custom binary works fine.

Can you send the log file for both situations, when working and when not.

Here is working: http://paste.ulvis.net/RtYOC0aF
Non-working: http://paste.ulvis.net/yEfL5CQH

I can confirm I experience the same issue:
Platform: Windows 10 x64
Kodi 17.6 fresh install
Elementum v0.49
How to replicate issue:
Elementum starts fine if memory is defined as storage: log file -> https://openload.co/f/CBzZzwMjBxQ/kodi.log
Elementum doesn't start if file is defined as storage: log file -> https://openload.co/f/Gk11qQwCczI/kodi.log

The problem persists also in version 0.48, last version that works fine is version 0.47.

@dbarev  @Jezze83 can you try this binary -
archive.zip ?

I tried the archive.zip binary and same issue, reverted back to .47 and it worked again

@dauvigne161 have you replaced two binaries on the disk with the one in archive.zip ?
Can you show the log?

Thanks for the quick response... I forgot their was 2 locations. It is working now, thank you!

@dauvigne161 so you have replaced 2 locations with the binary in the archive.zip and Elementum is running fine? (Just to clarify, so we can finalize this)

Yes that is correct

@dauvigne161 awesome. Thanks.
You can use this binary, it's a latest version of Elementum. When new version comes out - it will be automatically replaced by a newer one.

Awesome... Thank you for the help

I assume i dont need to test that? Can you also add option ”update trakt when daemon start”, so it automatically update trakt and library.

@Jezze83 library update runs automatically, then trakt update proceeds.

@elgatito I can confirm the attached binary is working fine on both windows 10 x64 and windows 8 x64.
Thanks much! I guess you will keep the changes for the next update right?

@dbarev yes, next version will include the fix.

Version 0.0.50 should include the fix.
Please write if it was updated fine and running without problems.


[Question]: Unable to Add Balance via NPM Command due to Low Node.js Version

What is your question?
I’m currently experiencing an issue where I am unable to use the npm run add-balance command to add balance to users because my server’s Node.js version is 16, which seems to be too low to support the necessary features or packages required by the command. I believe that the command requires at least Node.js 18. Due to infrastructure limitations, I am not able to immediately update Node.js on the server.
Could you please provide guidance on how to manually add a balance entry directly in the MongoDB database? Specifically, I would like to know:

Which collections and fields are involved when adding a balance to a user?
The exact steps or structure needed to manually insert the necessary data into MongoDB, to replicate what the add-balance command does.

Thank you for your help!
More Details
I am using Node.js version 16 and CentOS 7.9, which limits my ability to effectively use certain npm commands. I would appreciate detailed instructions to ensure that I correctly add balances to users without using the command line interface. If there are any specific examples or MongoDB queries I should use, that would be very helpful.
What is the main subject of your question?
User System/OAuth
Screenshots
Manually adding balance to MongoDB due to low Node.js version.
Code of Conduct

[X] I agree to follow this project's Code of Conduct

I'm such a fool; it turns out the command was inside a Docker container. The issue can be closed now.


About using the default certificate during installation

Hello, I am new to portainer and I am reading the instructions and it appears:

About using the default certificate during installation

I am using my own server and my IP has a domain name and certificate bound to it, I wonder if there is a conflict with my domain name and certificate?
Thanks!

@TingTing1990
Where do you see About using the default certificate during installation
If you want to use your certificate for Portainer you can either specify the certificate while deploying Portainer or from the Settings UI after deployment.


:class dosnt work correctly

What problem does this feature solve?
`
why red class dont effect?
What does the proposed API look like?
@vue/cli 4.5.15

`

      Hello Vue.js

`


Violate formatter policy

This PR is solely for testing whether the pipeline fails if the format policy is violated.

The formatter works as expected; nothing left to do here.


Proposal: allow already cloned repo

For example, I have repos on Bitbucket, even though only Github is supported, which is fine. It would be nice to add the option to generate the txt file of the cloned repos on your machine. Ex:
git2txt .

When . is the pathname

Hi @aralroca, thanks for opening this issue! This is a valuable enhancement that would make the tool more versatile. I'd like to suggest two possible approaches for discussion:
Approach 1: Using --local flag
# Using a dedicated flag for local repositories
git2txt --local /path/to/local/repo

# Examples:
git2txt --local ./my-project
git2txt --local ~/Projects/my-repo
git2txt --local /Users/developer/Projects/some-repo

Approach 2: Using file:// protocol
# Using Git's URL format
git2txt file:///path/to/local/repo

# Examples:
git2txt file:///./my-project
git2txt file:///home/projects/my-repo
git2txt file:///Users/developer/Projects/some-repo

The --local approach feels more straightforward - you just point it to your folder and it works. It's similar to how many other command line tools work, which makes it pretty intuitive, especially if you're new to the tool.
The file:// approach is interesting because it sticks to how Git itself handles local repos. It might look a bit more technical at first, but it could make it easier to add support for other sources in the future without adding more flags.
Both ways would make the tool faster since we wouldn't need to clone the repo again. I'm curious what others think would feel more natural to use day-to-day? Would love to hear everyone's thoughts on this.

Is there anyone working on this issue @aralroca @AlpTalhaYazar @addyosmani


TypeScript support

Not sure if you would be interested in TypeScript version. It can be helpful in some cases.

Not interested, but thanks for offering.


Design twitter bot and build PoC

Brainstorming: https://docs.google.com/document/d/1SBfAIww3c-gr-TSvogWhbQyHyixkihvuqryiWMhVSVc/edit

PoC completed, need somewhere where to host it.


SS4?

Any plans to update this module for SS4?

Hi @guyvanbael ,
Check out the 4.0 branch: https://github.com/toastnz/open-graph-meta/tree/4.0
It was made a little while ago, but since this is a relatively simple module it should be fine.
Please let me know if it doesn't install properly! I plan on switching the modules after SS4 is officially stable.


[WIP] New homepage

screencast

Great! what's left for RFR?

Fixes from @Kmaschta's review. Wording review. Better screenshots using the real bot


Add installation steps for MacPorts

Hi! Thanks for creating this tool. I noticed that it was missing from the MacPorts package manager on macOS, so I added the package and created this PR for updating the README with installation steps. Please take a look at https://ports.macports.org/port/totp-cli/summary for more details.
Relevant links:

MacPorts: https://www.macports.org/
Installation Config: https://github.com/macports/macports-ports/blob/master/security/totp-cli/Portfile

Thank you ❤


[To Main] Feature - DESENG-627 use createBrowserRouter() in-app

Issue #: https://github.com/bcgov/met-public/issues/
Description of changes:

Feature Use createBrowserRouter insead of <BrowserRouter> in the App component 🎟 DESENG-627

Updated the App component to use the more flexible createBrowserRouter function instead of the  component
This enables the use of data router functionality and other advanced features in the future, most notably the Blocker component
Added the AutoBreadcrumbs component to the common components library, which will be used to generate breadcrumbs based on the current route

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the met-public license (Apache 2.0).

Codecov Report
Attention: Patch coverage is 46.42857% with 15 lines in your changes missing coverage. Please review.

Project coverage is 75.96%. Comparing base (ebec3bf) to head (4ddd210).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2534      +/-   ##
==========================================
- Coverage   76.00%   75.96%   -0.04%
==========================================
  Files         604      604
  Lines       21785    21805      +20
  Branches     1663     1673      +10
==========================================
+ Hits        16557    16564       +7
- Misses       4965     4978      +13
  Partials      263      263

Flag
Coverage Δ

metweb
64.56% <46.42%> (-0.06%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files
Coverage Δ

met-web/src/components/common/Layout/index.tsx
100.00% <100.00%> (+18.18%)
:arrow_up:

...eb/src/components/layout/Header/InternalHeader.tsx
70.21% <100.00%> (+0.64%)
:arrow_up:

met-web/src/components/layout/SideNav/SideNav.tsx
90.90% <100.00%> (+0.28%)
:arrow_up:

...eb/src/components/common/Navigation/Breadcrumb.tsx
46.42% <16.66%> (-53.58%)
:arrow_down:


Update remix IDE compile error

Specifies the version of Solidity, using semantic versioning.

I recommend locking in a specific Solidity compiler version to make it simpler to verify contracts.


"Permission tests" job runs even if there aren't tests require permission in the repo

Actual
Tests with permission cost 2.5m in SDK per run
Expected
Tests with permission should cost 0m in SDK per run (because no tests with permission in sdk)
Build
https://github.com/networkservicemesh/sdk/actions/runs/5725018079/job/15512654809

Seems like done by https://github.com/networkservicemesh/.github/pull/44


implement entrypoint

There are two kinds of entrypoints planned:

command (default): this is like Dockerfile CMD

service-bundle: this generates an s6 service bundle, I need to talk with laurent about how to best implement this one :)

This is implemented now :)


osbuild: always return exit code

osbuild_cli() sometimes returned an exit code, but at the end called
sys.exit() directly. The idea was probably to always return the code
with which the executable should exit.
Make this consistent and call sys.exit() in main.py, with the value
returned by osbuild_cli().

:heart: very cool! I wonder if there is a good way to test this, so that we catch this the next time we restructure the code ;)

heart very cool! I wonder if there is a good way to test this, so that we catch this the next time we restructure the code ;)

I guess a invalid manifest and an invalid checksum would at least catch some of the cases.


Escalation: fix blacklist stuff

Coverage decreased (-0.006%) to 31.619% when pulling 0579784b41d293fa933d07be890989ebf08491f6 on calixteman:fix_escalation into ce5c67900052a3dff23e9e0b2848214387dd79d0 on mozilla:master.

what means "stuff" ? :)

For the escalation, we set a blacklist containing dcamp and when dcamp is reached we fall back on the dev himself.
So the goal of this patch to fall back on the manager of the dev when dcamp is reached.
And since dcamp is a vp, remove "vp" from conf file to nag the corresponding director instead (since we don't want to nag dcamp).


adding_mailto_tel_functionallity

solve issue #102 #77
you change the branch from main to the dev and i forked your main branch...sorry for this reason i don't understand why the merge conflicts is come sorry for late and please mearge it and review it

@AnitSarkar123 i will fix this and will merge this

@MAVRICK-1 sir can you please assign me the issue no. #207

@AnitSarkar123 i will fix this and will merge this

Sir @MAVRICK-1 when you will merge it

@AnitSarkar123 my exams are going on , when i will get free time , i will do it

@AnitSarkar123 my exams are going on , when i will get free time , i will do it

Ok no problem sir @MAVRICK-1

@AnitSarkar123 my exams are going on , when i will get free time , i will do it

Ok no problem sir @MAVRICK-1

Sir @MAVRICK-1 can you marge it because today leaderboard will be release

@AnitSarkar123 i will to merge it by 8:00 pm , I got exam today

@AnitSarkar123 i will to merge it by 8:00 pm , I got exam today

Ok,sir no problem also my exams are starts from June 1

@AnitSarkar123 i will to merge it by 8:00 pm , I got exam today

Ok,sir no problem also my exam is starts from June 1

@AnitSarkar123 error fixed done , mergin , congratulation for your first contribution

@AnitSarkar123 error fixed done , mergin , congratulation for your first contribution

Sir @MAVRICK-1 you give level 2 in issues but why level 1 in the PR

@AnitSarkar123 according to the new guidelines this doesn't fall under level2

Sir @MAVRICK-1 can you send me the guidelines link because I don't know the guidelines even I don't know what is the meaning of level 1,lavel2, lavel3

Sir @MAVRICK-1 can you send me the guidelines link because I don't know the guidelines even I don't know what is the meaning of level 1,lavel2, lavel3..

Sir @MAVRICK-1 can you send me the guidelines link because I don't know the guidelines even I don't know what is the meaning of level 1,lavel2, lavel3

And what is the lavel of issue #207


substitution fails simple test

I'm surprised our unit tests haven't caught this. Minimum working example:
from gpkit import Variable
x = Variable('x')
y = Variable('y')
p = 1 + x**2
q = p.sub({x: y**2})
assert q == (1 + y**4)

output:
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-2-db08612a9cfb> in <module>()
      3 y = Variable('y')
      4 p = 1 + x**2
----> 5 q = p.sub({x: y**2})
      6 assert q == (1 + y**4)

.../gpkit/nomials.pyc in sub(self, substitutions, val, require_positive)
    169         varlocs, exps, cs, subs = substitution(self.varlocs, self.varkeys,
    170                                                self.exps, self.cs,
--> 171                                                substitutions, val)
    172         return Signomial(exps, cs, units=self.units,
    173                          require_positive=require_positive)

.../gpkit/substitution.pyc in substitution(varlocs, varkeys, exps, cs, substitutions, val)
    147                 varlocs_[sub].append(i)
    148             elif isinstance(sub, Monomial):
--> 149                 if isinstance(var.descr["units"], Quantity):
    150                     try:
    151                         new_units = var.descr["units"]/sub.units

KeyError: 'units'

This appears to come from trying to look up var.descr["units"] when var has no units. I see two possible resolutions:

Force all VarKey descrs to have a units attribute.
Don't try to look up var.descr["units"] without confirming it exists, or otherwise refactor the approach.

@bqpd, any thoughts?
Todos:

[ ] Decide on option 1 or 2 above
[ ] Implement
[ ] Add unit test (at least the MWE above)
[ ] The substitution function looks like it could use a refactor.

Related to #273

Let's work on this on the sub_improvements branch under #270.

I'm leaning slightly toward option 1. In particular, we would make units a first-class attribute of all Signomial objects (and therefore of all Variable objects by inheritance). This would enable stuff like the following to always work:
if v.units:
    print "The units of v are %s" % v.units
else:
    print "v is dimensionless"

Anyone have any other opinions or seconds?

Haven't tried this fix, but it looks to me like we could adopt a variant of option 2 above, where we simple replace var.descr["units"] with var.units.

That could work, and give everything a unit.

Ok, proposed fix for 3 out of 4 checkboxes pushed to branch over at #270

What makes you think substitution could use a refactor?

A few things:

getsubs and vectorsub are undocumented and confusing (they seem to have similar roles, but one returns something, and the other operates by side effect)
In #273 we discussed that functions involving varlocs, exps, cs, should perhaps be implemented as part of a renamed PosyTuple
A lot of repeated code, e.g. under elif isinstance(sub, VarKey) vs elif isinstance(sub, Monomial).
"too-many-branches" warning from pylint -- feels like a maze of conditionals...

I'm going to copy the above to a new issue, since this one is closed -- we can of course close it if we decide it shouldn't exist.

Sounds good! Some amount of this is attempting to do typed programming in Python. :-/ Which would be great to fix, I'm just not sure how.


LAB2 issues? After 2 compiling, successful display $437.00

These steps, may need to be aware of:

update the data set if you reopen the VS code, need to set new filter to download your own
follow the instructions to idetify the lines which show the wrong clause used for Numeric figure
back to CBL, amend   gross pay variable clause  x(5) to $$$$$.99 and save, resubmit job.

@Dlthomass - The solution your provided in your Step #3 above may have worked correctly in this modern Cobol compiler, but it is not considered good style and may not work in older Cobol compilers.  You see, you cannot use a "DISPLAY" type definition within a COMPUTE statement.  A character, such as "$" or ".", makes your GROSS-PAY variable a "DISPLAY" type variable.  The proper way to use "DISPLAY" type variables is to MOVE a value to it, after calculating it using a numeric defined variable.  So, your GROSS-PAY could be defined as PIC 9(5)V99 and then moved to a new variable, GROSS-PAY-DISPLAY PIC $(4)9.99. The "V" represents an implied decimal point.  The new definition means, print a "$" immediately to the left of the first significant number (greater than zero), within a 4-byte field.  The "9.99", means print all digits, when the value contained in this variable is less than 10.00.  This is a technique to ensure zero is printed as "0.00" or in this case, "$0.00".  In your example, zero would print as "$.00".  Perhaps that is what you would prefer.

@sccosel thank u


Sitewide search from the identity app (account pages) seems to be broken

What
From Slack:
Sitewide search from the identity app (account pages) seems to be broken for me; I get sent to a 404 on https://wellcomecollection.org/account/search?query=Not+working
To do

[ ] Get search working on account pages

When you're logged into your account (https://wellcomecollection.org/account), sitewide search from the global navigation should behave as if you're on any other page – e.g. typing "venice" into the search bar and running a search should take you to https://wellcomecollection.org/search?query=venice, not https://wellcomecollection.org/account/search?query=venice
Does that make sense?


Correct array capacity of workers in pool.GetWorkers.

Codecov Report

Merging #221 (4e61321) into develop (6f93f8c) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##           develop     #221   +/-   ##
========================================
  Coverage    54.85%   54.85%
========================================
  Files           43       43
  Lines         4525     4525
========================================
  Hits          2482     2482
  Misses        1894     1894
  Partials       149      149

Flag
Coverage Δ

unittests
54.85% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

pkg/worker/pool.go
62.25% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f93f8c...4e61321. Read the comment docs.


Clock API

Clocks are an important part of all microcontrollers that I know of, and I believe this is a topic that should be covered in embedded-hal. I don't have a good enough overview over the topic to know everything that's required, but I have encountered some use cases that gave me a few ideas.
I've implemented a rough proposal as part of LPC82x HAL. This is not quite ready for inclusion into embedded-hal, but I've decided to open this issue to garner some feedback, and give others the opportunity to mention other use cases that I haven't covered.
Here's the API that I'd like to submit (eventually):

Overview: lpc82x_hal::clock
A trait that returns a clock's frequency: clock::Frequency
A marker trait for enabled clocks: clock::Enabled
A struct to represent durations: clock::Ticks

Use cases for the API:

Implementations of the traits: LowPowerClock, IrcDerivedClock
Sleep code that depends on various bits: Sleep
I also have an unrelease time library that depends on this infrastructure. I haven't had time to polish and release it yet, but I'll happily send the code to anyone who wants to take a look.

As I said, this is still a bit rough. https://github.com/braun-robotics/rust-lpc82x-hal/issues/4 has some
ideas for improvement. I'd love to hear what everyone thinks!

This looks like a good proposal to me. It would solve most issues I pointed out in #46.
One thing it doesn't directly solve is specifying timeouts for CountDown without knowing what Timer::Time is? Perhaps you could give them a Fn(Frequency) -> Ticks. Or perhaps that should be a separate struct since they are not completely related.

@TheZoq2 I think your problem is somewhat orthogonal to this proposal. Even if this were adopted, and CountDown's method would be changed to take Into<Ticks> instead, we'd still need the associated type, as Ticks as currently specified is not portable enough. The u32 needs to be replaced with a type parameter, and that type parameter would then still show up as CountDown's type Time.
I can think of only one good solution to your problem: Choose a type that has enough range for your timeouts (u16, for example) and require the user to provide a function that converts from that type to whatever CountDown's type Time happens to be.
Your driver should ideally be as general as embedded-hal is, so it shouldn't make any assumptions about the data type that the timer uses. But the end user, that ends up running your driver on a specific microcontroller, has the knowledge to convert from your type to the one used by the CountDown implementation.
If this proposal were part of embedded-hal, and a time library based on it would show up, then that time library might help with this problem. As of now, I don't know exactly what that would look like though.

Oh yea, you have a point. At some point, the amount of ticks in the timer is stored in some datatype, probably an unsigned int of some kind but it would depend on the timer. A driver could specify that the type should be a u16 for example, but what datatype is required depends on the frequency of the timer which is not known.
One solution I could think of for this would be to define some new types like Second, Millisecond and Microsecond as well as additional countdown traits like CountDownSecond etc. It would then be up to the device crate implementor to implement these for all the timers that are capable of "enough precision/range" to accurately meassure such times.
Of course, this isn't without issues either. "enough precision" is very vague and a timer might be capable of counting for 10 seconds but would then overflow. The behaviour after 10 seconds would then be undefined.
As you pointed out, these proposals are not completely related. Do you think I should reopen mine and keep the discussion goging there or should we continue here?

One solution I could think of for this would be to define some new types like Second, Millisecond and Microsecond as well as additional countdown traits like CountDownSecond etc. It would then be up to the device crate implementor to implement these for all the timers that are capable of "enough precision/range" to accurately meassure such times.
Of course, this isn't without issues either. "enough precision" is very vague and a timer might be capable of counting for 10 seconds but would then overflow. The behaviour after 10 seconds would then be undefined.

Your idea is interesting, but I'm not sure if this is something that should go into embedded-hal, at least at this point in time. I think this whole topic of time and its representation will require a lot of experimentation before we'll be ready to judge what a good solution would be like, and this experimentation should probably happen in dedicated crates.
Once it has become clear what a good solution is, we can decide whether to merge it into embedded-hal or keep it separate. Maybe someone with a better grasp on the topic than me might disagree.

As you pointed out, these proposals are not completely related. Do you think I should reopen mine and keep the discussion goging there or should we continue here?

I think it's fine to have this discussion here, as it relates to use cases for the proposed clock API.

Your idea is interesting, but I'm not sure if this is something that should go into embedded-hal, at least at this point in time.

Yep, that makes sense. Since I have some time available this week, I'll try implementing what I proposed and see if I run into any issues along the way.

I just wanted to add quickly that I would hope that any time period given
in seconds (or fractions thereof) would convert to clock ticks at compile
time, as it would in a C program with a F_MHZ define or similar.
Jonathan

Yep, that would be ideal. However, im not sure if that's possible with the current structure of the crate. As far as I can tell (at least in stm32f103xx), the frequency of all the clocks in the system is read (and then fixed) at runtime when you create a clocks object.

This turned out to be a simpler to implement that I thought. I created a crate called embedded-hal-time containing a single trait called RealCountDown which is generic over a time type. I added 3 time types Seconds, Milliseconds and Microseconds which are simply newtypes around u32. RealCountDown also has CountDown as a supertrait for code reuse.
I also added an implementation of that trait to my fork of the stm32f103xx_hal crate. The implementation is not perfect, there is some code duplication between it and the normal Timer::start function and some probably expensivie divisions in the case of Microsecond and Millisecond.


Should be able to delete old templates

Currently It's not possible to delete old Excel submission templates. This results in a long list of old templates that aren't needed

Templates are not explicitly uploaded, therefore there is no concept of an 'old' template any more


Change the Table in Quizzes  visual: States started as per plan

Refer NCERT Quiz Sheet in Data Source Excel file.
In that data source file - Color gradient should be applied to Completion% column, Non-Completion% and Status date columns are not required.

Table is Changed.


NestJS v9 incompatible with version 5

i get this error
TypeError: store.get is not a function
    at Object.get (.../node_modules/cache-manager/src/caching.ts:88:36)
    at AppController.getHello

Im implementing caching following the NestJS docs.
this is my posting on stackoverflow (https://stackoverflow.com/questions/73908197/typeerror-store-get-is-not-a-function-nestjs-cache-manager)
but when im switch to version4 then its working.. but i dont know why.
i wonder this is just my fault or version issue
-> i try to find difference but i think get method's logic is same(using lru-cache package). so maybe type issue?
if this is my fault, then can you tell me how to solve it?

I have the same issue

same here...back to version @4.1.0 and wait

same here...back to version @4.1.0 and wait

The cache construction is now async. Thats why you need to await it.
I also have issues with this: dependency injection with both Awilix and NestJS is breaking. Constructors should be sync.
Why is this Promise based now? Can this be avoided or made sync as fallback for users who don't have the luxury of awaiting?

same issue with latest NestJS

+1 for a fix for this

After some investigation, it appears the caching method's signature has changed to now accept a factory as the first parameter and options as the second vs the old single options object that included the store. Nest will need to update some code to support v5, but I make no guarantees if we'll concurrently support v4 and v5 or just v4 until Nest v10 is released.
This change was rather hard to find as the old lib/caching and the new src/caching have different git histories and there's no changelog explicitly mentioning this change

My fix for NestJS was to downgrade to "cache-manager": "3.6.3",.
This is also forced by @micalevisk 's PR here.

+1 for a fix.
I believe this is the commit that broke everything. A "Breaking Changes" should have been issued.

Sorry for the delay. It is that there are breaking changes that have not been introduced in the NestJS documentation because the version is very early.
Now I put an example of how to implement it with the new version while it is being updated in NestJS.

I'm no longer the maintainer of this project, but:

The major version was revved from 4 to 5, which implies that there is (or could be) a breaking change.
Users should specify a version (or at least a version range) in their projects to prevent breaking changes from causing problems.

But I also agree that the constructors should not be async.

@WaylonOKC as this was over a semver major version, a breaking change was fine. It's just that until now, Nest's peerDeps were okay with any version of node-cache-manager. Therefore, no "fix" is necessary from this library. I'll be working on an update for Nest to figure out if support ing v4 and v5 simultaneously is possible

The problem is:
https://github.com/nestjs/nest/blob/746533214ea1f3ad1aff1d13fd72d293a30d1fa9/packages/common/cache/cache.providers.ts#L30-L33
I have changed the definition of the function caching and multicaching. It can't work with both versions.
Specify in the NestJS documentation and its dependencies.
I already have the commit to update NestJS but it won't take long until they release a version.
I'll leave this open if anyone has the same problem:
npm i cache-manager@^4

Any change of adding a bit of documentation on how to achieve the same results with the new version? I too am trying to update my code to v5 but following just the commit messages seems a bit confusing and I'm getting similar type errors when using the caching function.
Not complaining, just would like to know if we could have a thorough guide on how to update from one version to another.
Thanks!

Any chance of adding a bit of documentation on how to achieve the same results with the new version? I too am trying to update my code to v5 but following just the commit messages seems a bit confusing and I'm getting similar type errors when using the caching function.
Not complaining, just would like to know if we could have a thorough guide on how to update from one version to another.
Thanks!

Ok, I'll make a guide. But this is what I did to migrate this Store. Other Store implementations may not have updated types
https://github.com/node-cache-manager/node-cache-manager-redis-yet/commit/3e25560765759af00005f12203ce2b594800c208#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80

@WaylonOKC as this was over a semver major version, a breaking change was fine. It's just that until now, Nest's peerDeps were okay with any version of node-cache-manager. Therefore, no "fix" is necessary from this library. I'll be working on an update for Nest to figure out if support ing v4 and v5 simultaneously is possible

Breaking changes are often expected by a major version, but they definitely should be called out and not just left to be discovered after people upgrade.
FWIW, this thread started out as a "TypeError" and not specifically a NestJS incompatibility.

Hi Team,
Any update?

@srinivasan-getstan there's nothing really to update. botika was kind enough to provide an example of how to use cache-manager@^5 with Nest if you want to use that until a stable fix gets merged in with Nest's code base. Otherwise, v5 s a breaking change and you should use v4 for the old functionality. ThisPR should fix any usage issues between v4 and v5, at least in the tests I've done when creating it, but we'll have to wait for it to get merged in and published, which may take a bit. Until then, as I said, there's nothing cache-manager needs to do about this, they correctly released a major change, which can include breaking changes, and that's that.

Thanks, @jmcdo29

Hi Team, Any update?

Basically, I did https://github.com/node-cache-manager/node-cache-manager/commit/12020d8de62142d47c28dba0cf1f820328488663 and remove it.
I would use version 4 until nest is updated or you can use that module. There are also not many updated Stores yet.

node-cache-manager version 5 does not work with Nest version 8 either

For the ones using cache-manager-redis-store, you also need to downgrade it to v2.0.0 (instead of 3.0.1).

Also, you have to import the different type from the docs.
import type { RedisClientOptions } from 'redis' instead of import type { ClientOpts } from 'redis'

I'm getting the same error and it looks like it hasn't been updated yet !

If you are coming here from the NestJS caching Redis tutorial, use these dependencies:
"cache-manager": "4.1.0",
"cache-manager-redis-store": "2.0.0",

@vincentwinkel thanks

Fixed in<EMAIL_ADDRESS>Thanks all!!

Hi. This still does not work for me even after updating it to 9.2.0.
Below is the code for initiating CacheModule in app.module.ts:
CacheModule.register<RedisClientOptions>({
     isGlobal: true,
     store: redisStore,
     host: 'localhost',
     port: 6379,
   }),

Versions:
cache-manager: 5.1.6
redis:3.1.2
cache-manager-redis-store:3.0.1

This is work for me.
redis: "^3.1.2"
cache-manager: "^5.1.3"
cache-manager-redis-store: "^3.0.1"
 CacheModule.registerAsync<any>({
      isGlobal: true,
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: async (configService: ConfigService) => {
        const redisConfig = configService.get<RedisConfig>('redis');
        const storeConfig: CacheModuleOptions<RedisClientOptions<RedisModules, RedisFunctions, RedisScripts>> = {
          url: `redis://${redisConfig.host}:6379`,
        };
        if (redisConfig.auth) {
          storeConfig.password = redisConfig.auth;
        }
        const store = await redisStore(storeConfig);
        return { store: () => store };
      },
    }),

cache-manager-redis-store: "^3.0.1"

Is not updated. Use https://github.com/node-cache-manager/node-cache-manager#official-and-updated-to-last-version instead

Hello, I'm having the original issue of @rurruur
My setup:
import * as redisStore from 'cache-manager-redis-store';

CacheModule.registerAsync({
    imports: [ConfigModule],
    inject: [ConfigService],
    isGlobal: true,
    useFactory: async (configService: ConfigService) => {
        console.log({...configService.get('redis')}); //  Output: { host: 'localhost', port: '6379', password: undefined }
        return {
            store: redisStore as unknown as CacheStore, // Hotfix
            ...configService.get('redis'),
        };
    },
}),

import { CACHE_MANAGER, Inject, Injectable } from '@nestjs/common';
import { Cache } from 'cache-manager';
@Injectable()
export class UsersService {
    constructor(
        private userRepository: UserRepository,
        @Inject(CACHE_MANAGER) private cacheManager: Cache,
    ) {}
    async findAll(): Promise<User[]> {
        console.log(this.cacheManager.get);                                                           // Output: [Function: get]
        const value: User[] | undefined = await this.cacheManager.get('find_all'); // Here I get : TypeError: store.get is not a function
        if (value) {
            console.log('From cache');
            return value;
        }
        const dbList: User[] = await this.userRepository.find({
            relations: { oncall_request: true },
            order: { first_name: 'ASC', last_name: 'ASC' },
        });
        await this.cacheManager.set('find_all', dbList, 3000);
    }

Backend:
cache-manager: 5.1.7,
cache-manager-redis-store": 3.0.1
nest: 9.3.9
Other:
redis: 7.0.8

to resolve that i need to change the "cache-manager": "^4.0.0", and if you use redis "cache-manager-redis-store": "2.0.0"

I managed to solve this with:
"cache-manager": "^5.2.0",
"cache-manager-redis-yet": "^4.1.1",

My module file:
import { redisStore } from 'cache-manager-redis-yet';
import { Module, Global } from '@nestjs/common';
import { CacheModule } from '@nestjs/cache-manager';
import { ConfigModule, ConfigService } from '@nestjs/config';

import { RedisService } from './redis.service';

@Global()
@Module({
  imports: [
    CacheModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: async (configService: ConfigService) => ({
        store: await redisStore({
          url: configService.get('REDIS_URL'),
          database: 0,
        }),
      }),
    }),
  ],
  providers: [RedisService],
  exports: [RedisService],
})
export class RedisModule {}

My provider file:
import { Inject, Injectable } from '@nestjs/common';
import { CACHE_MANAGER } from '@nestjs/cache-manager';
import { Cache } from 'cache-manager';

@Injectable()
export class RedisService {
  constructor(@Inject(CACHE_MANAGER) private readonly cache: Cache) {}

  async get(key: any) {
    return await this.cache.get(key);
  }

  async set(key: any, value: any, ttl: number) {
    await this.cache.set(key, value, ttl);
  }

  async del(key: any) {
    await this.cache.del(key);
  }
}

You are welcome.

My cache.module.ts
import { Module } from '@nestjs/common';
import { CacheModule as _CacheModule } from '@nestjs/cache-manager';
import { ConfigModule, ConfigService } from '@nestjs/config';

import { RedisClientType } from 'redis';
import { redisInsStore } from 'cache-manager-redis-yet';

import { REDIS, RedisModule } from '@app/redis';
import { CacheService } from './cache.service';

@Module({
  imports: [
    _CacheModule.registerAsync({
      imports: [ConfigModule, RedisModule],
      inject: [ConfigService, REDIS],
      useFactory: (config: ConfigService, redis: RedisClientType) => {
        const conf = {
          ttl: config.getOrThrow<number>('REDIS_CACHE_TTL'),
        };
        return {
          store: redisInsStore(redis, conf),
          ...conf,
        };
      },
    }),
  ],
  providers: [CacheService],
  exports: [_CacheModule, CacheService],
})
export class CacheModule {}

My cache.service.ts:
import { Inject, Injectable } from '@nestjs/common';
import { CACHE_MANAGER } from '@nestjs/cache-manager';

import { RedisCache } from 'cache-manager-redis-yet';
@Injectable()
export class CacheService {
  constructor(@Inject(CACHE_MANAGER) public readonly cache: RedisCache) {}

  async clean(pattern: string) {
    for await (const key of this.cache.store.client.scanIterator({
      MATCH: pattern,
    })) {
      await this.cache.store.client.unlink(key);
    }
  }
}

Thanks all for use it!

@botika may I know if there's a repo of that code you sent above? I would like to check it. Thanks.

wrote this on stackoverflow, it should help https://stackoverflow.com/a/76777854/16362460

wrote a fix for newer version of cache-manager(v5 and above) on stackoverflow, it should help https://stackoverflow.com/a/76777854/16362460


Initial www-dev playbook

Development of a new web server for OME website migration.
Private config in https://github.com/openmicroscopy/management_tools/pull/474

Thanks for review @sbesson  - I am planning to remove the ON_HOLD label once the relevant config is able to be merged, i.e. after the removal of vault.

A couple of additions proposed in https://github.com/kennethgillen/infrastructure/pull/1 to match the current gem requirements of www.openmicroscopy.org (incl. . There are still a few gotchas but I think we are close to a state where we can merge this playbook as a first working pass and start working on the nginx configuration.

Thanks, Seb. Not sure how we started NGINX before.. but good to have it in now.

With the last commit, tried to the deploy the entire website from a freshly snapshoted VM using ansible-playbook --ask-become-pass server-state-playbooks/www-dev/www-dev.yml. Barring the issue discussed below, everything worked as expected with the static content being served by nginx as expected.
Merging this alongside with the private PR containing the variables to allow the work on the Nginx configuration files (SSL + redirects work). On the Jekyll front, the main issue is that the bundle install step systematically fails with  No such file or directory error forcing the playbook to be executed twice for every code change. Merging this playbook as it is also allows to investigate this issue separately.


Create an ivadomed download function

instead of having developers and users use curl (e.g. in tutorial, for testing) as we currently advise, we should have an ivadomed downloader. Pros:

currently, when unpacked, bundled artifacts on github have the name of the release as suffix, which is problematic (we need to manually rename them, creates confusion, etc.)
having a downloader, we can maintain a database listing the different URLs, mirrors, etc. for each dataset

Is it a problem to use the code from spinalcordtoolbox for this function ? (not import it to avoid cross dependency but duplicate it)

i would be ok with it. @Drulex @kousu ?

I don't see a problem.


cleanup(libsinsp): add scanf formats and fixed size variables in stats.cpp

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind cleanup

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area libsinsp

Does this PR require a change in the driver versions?
No

What this PR does / why we need it:
Tiny refactor of the stats implementation:

Use fixed size ints (uint64_t) when reading status files
Use the corresponding format specifier for fixed size ints (guarding against compilation warnings)
Remove an assert on a condition that may actually happen (it does when you run UTs, especially as non-root)

cc @incertum @jasondellaluce
Which issue(s) this PR fixes:

Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:

NONE

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: LucaGuerra
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [LucaGuerra]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

LGTM label has been added.  Git tree hash: d23df0ec67c70e144afb4280c0af211945f1fd3a

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: jasondellaluce, LucaGuerra
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [LucaGuerra,jasondellaluce]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Andreagit97, jasondellaluce, LucaGuerra
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [Andreagit97,LucaGuerra,jasondellaluce]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


Fix vector creation with unordered maps

CompressedVector stores the underlying data in a two arrays: A values array and a indices
array. The values array matches the indices array, and they're both sorted by the indices
array. To get a value at an index, the index is found in the indices array with a binary
search and the respective value is obtained from the values array.

Since the lookup is done as indicated above, it is important that the values and indices are stored in sorted order for binary search to work properly.
Closes #290

Thanks @bashok001! This looks good to me.


Yii 2Flexible Routes With Unlimited Get Parameters

As advised by @cebe i should create an issue for the following:
Suppose there exists a scenario where you enter controller:w+/action:w+/page/page:+d/limit/limit:+d but you would like the rule to be flexible to accept controller:w+/action:w+/limit/limit:+d/page/page:+d without setting two rules, how would you achieve this?
I remember in yii 1.1 this could be achieved by either using controller:w+/action:w+/* or controller:w+/action:w+?(/page/page:+d)?(/limit/limit:+d)?

Any progress or changes on this?

I don't understand the necessity of supporting this. You want two forms of URL formats and you only want a single rule? Yii 1.1 can't solve this problem either.

Urls are not flexible in the pretty url format where a parameter can exist any where after the url pattern. You might have a pattern where you may not know all the parameters that are required initially and later on add additional ones so instead of changing the URL rule itself, the rule is flexible in a manner to accept additional params immediately.
I am yet to find out how to configure this manner of flexibility in YII2 where in Yii 1 all that had to be done was setup the parameter rule with a /* for arguments sake.
Some of us developers have transitioned from using the url query characters in our url and would like to use the pretty url format throughout our applications and this is why it is a necessity.

Allowing multiple forms of URL to point to the same resource is a bad idea for SEO. You should use GET parameters in this case. That's why Yii2 dropped the support of /*. You also won't find such support in other modern frameworks.

Ok, so converting a yii 1 application with this implemented would require redevelopment then. For the other form of optional parameters using the ?(/page/page:+d)? in yii 1.1, is this also bad for SEO because this isnt supported either in yii 2.

I don't think Yii 1.1 supports optional parameters. This is a new feature implemented in Yii 2 (not specified in this format though).

I have set out URLs in my yii 1.1 application that follow the ?(/)?(/)? pattern where the url does not have to accept a country param or code param. In Yii2 when i use the optional parameter and say i have a pattern like this
[
'pattern' => 'module:\w+/controller:\w+/edit/limitlimit:\d+/mode/mode:\d+',
'route' => '//edit',
'defaults' => ['limit' => "",'mode'=>""],
],
if I have no limit but I have a mode and I set only the mode in the URL I get a 404 page not found error but to achieve this I would have to setup an additional rule and that's where I find the flexibility with URL parameters more convenient in yii 1.1 compared to yii2.
I am just curious though, having ?page=1&limit=2 compared to /page/1/limit/2
and ?limit=2&page=1 compared to /limit/2/page/2 Why do I have to setup 2 different rules to achieve the pretty URL format where it does not matter when using the original query parameter string?

Allowing multiple forms of URL to point to the same resource is a bad idea for SEO. You should use GET parameters in this case. That's why Yii2 dropped the support of /*. You also won't find such support in other modern frameworks.

I agree with Qiang. With respect to the given arguments, I dont see the necessity to extend the framework for this.

It's simple functionality, and I think Yii2 need this.


cli: make 'check' ensure docker images build correctly

For an experiment that relies on docker, popper check implicitly checks that an image can be pulled. We can have a convention that if an experiment has a 'docker/' folder, every subfolder is an image and built it as part of check.

Jenkinsfile subsumes this