Use systemd to track daemons instead supervisord

Use systemd to track daemons instead supervisord, add variable use_systemd on inventory.ini, when set use_systemd=True will use systemd to manage services.
This PR is tested on Ubuntu and CentOS
When use systemd user must make sure systemd must be installed.

Ubuntu higher than 14.04 systemd is installed by default.
CentOS higher than 7 systemd is installed by default.

About Connection configuration, recommand use ssh via root and comment ssh via normal user.
ansible_user = root
ansible_become = true
ansible_become_user = tidb

# ansible_user = tidb

Thanks for your PR. We'll review it later.

[tikv_servers]
tikv-1-1 	 ansible_host=<IP_ADDRESS> 	 deploy_dir=/data1/deploy tikv_port=20171
tikv-1-2 	 ansible_host=<IP_ADDRESS> 	 deploy_dir=/data2/deploy tikv_port=20172

tikv-2-1 	 ansible_host=<IP_ADDRESS> 	 deploy_dir=/data1/deploy tikv_port=20171
tikv-2-2 	 ansible_host=<IP_ADDRESS>	 deploy_dir=/data2/deploy tikv_port=20172

We need to consider deploying multiple tikv instances on one server and cleaning up environment in unsafe_cleanup.yml and unsafe_cleanup_data.yml.

Is current version support this?

Hi, current version supports it by specifying different deploy_dir and tikv_port as above example. Some of our customers use it online.

Gotcha, I will fix for this.

@LinuxGit shall we support tidb  can be start by different deploy_dir and tidb_port in one host as tikv support?

@blacktear23 We can deploy multiple TiDB instances on one server when enable_binlog = False at present. We'll refactor it in the near future. Deploying multiple PD instances on one server is not recommended. For now, we can just support multiple TiKV instances on the same server.


run lighthouse concurrently

What:
run multiple lighthouse reports concurrently
Why:
speed 🚀
How:

Checklist:

[ ] Documentation
[x] Tests
[x] Ready to be merged
[ ] Added myself to contributors table

Codecov Report

Merging #10 into master will increase coverage by 1%.
The diff coverage is 97.29%.

@@           Coverage Diff           @@
##           master      #10   +/-   ##
=======================================
+ Coverage   93.33%   94.33%   +1%
=======================================
  Files           5        6    +1
  Lines         135      159   +24
  Branches       25       29    +4
=======================================
+ Hits          126      150   +24
  Misses          9        9


x/pkgsite: package documentation should immediately reflect UI changes

Currently, we need to reprocess the database on any UI changes (e.g. changes to the HTML templates), which can take several hours. Users who request packages that were not yet reprocessed will see the old HTML version, which when coupled with potentially new CSS changes, can have unexpected results. See #40078
We should allow the frontend to prioritize the reprocessing of any package that a user requests, so that users will always see the latest UI changes when viewing documentation.

Fixed.


Negative CRF loss if mask_zero=False

When training a simple model with CRF its loss becomes negative after some time if mask_zero=False, which I've noticed while working on a larger BiLSTM+CRF for NER. My bigger model converges to ~90% acc without the CRF layer and to ~95% with the CRF layer, but its loss starts slightly positive and keeps decreasing until it becomes negative. This behaviour is quite unexpected since, as far as I can tell, the model is optimised through minimising the predictions negative log likelihood.
In order to further study this situation I've developed the following toy model, which yields training loss of -0.0777 if mask_zero=False and 0.0217 otherwise. The reader might argue that the amount of epochs is exaggerated, and indeed it is, however I would like to remind that the purpose of this code is to simple reproduce an issue which was observed on a model trained with way more data on only 5 epochs. Furthermore the loss function stays positive if mask_zero=True even for larger values for EPOCH. I've tried to investigating this issue by myself by reading the code without Much success... maybe @linxihui, who is its main author, could point to some direction...
PS: Please notice that my word index on the embedding layer start at 1, hence mask_zero should not change anything...
import numpy

from keras.models import Sequential
from keras.layers import Embedding
from keras_contrib.layers import CRF

from numpy.random import seed
seed(1)

from tensorflow import set_random_seed
set_random_seed(1)

def build_dict(items):
    table = dict()
    for item in items:
        if item not in table:
            table[item] = len(table) + 1
    return table

def prepare_sequence(sequences, table):
    prepared = list()
    for seq in sequences:
        prep_seq = list()
        for item in seq:
            prep_seq.append(table.get(item, -1))
        prepared.append(prep_seq)

    return numpy.asarray(prepared)

data = [
    ('I went to Chicago from New York yesterday'.split(),
     'O O O B_LOC O B_LOC I_LOC O'.split())
]

words_table = build_dict(data[0][0])
labels_table = build_dict(data[0][1])

train_x = prepare_sequence([data[0][0]], words_table)
train_y = prepare_sequence([data[0][1]], labels_table)
train_y = numpy.expand_dims(train_y, -1)

EPOCHS = 700
EMBED_DIM = 10

print(train_x.shape)

model = Sequential()
model.add(Embedding(len(words_table) + 1, EMBED_DIM, mask_zero=False))  # Random embedding
crf = CRF(len(labels_table) + 1, sparse_target=True)
model.add(crf)
model.summary()

model.compile('adam', loss=crf.loss_function, metrics=[crf.accuracy])
history = model.fit(train_x, train_y, epochs=EPOCHS, validation_data=[train_x, train_y], verbose=0)

print(history.history['loss'][-1])
# outputs -0.0777437686920166 if mask_zero=False and 0.02171158790588379 otherwise.

Found this too

I also encountered this situation. But I am using CNN to do sequence labeling，so I cannot set mask_zero=True in Keras. When using RNN，the CRF loss is about 5-6, but when using CNN, the loss becomes quite small and then become negative.

What if you add a masking layer?

If you add a masking layer, the problem disappears, if I remember correctly.

I also encountered this situation. But I am using CNN to do sequence labeling，so I cannot set mask_zero=True in Keras. When using RNN，the CRF loss is about 5-6, but when using CNN, the loss becomes quite small and then become negative.

Hey ..did you find the solution?

Hey i found something .. change the learn mode of the CRF normal mode is join ..if you change it to marginal you will get sparse categorical cross entropy is sparse argument is kept true or else categorical cross entropy.

I just found a bug in CRF code, which is related to computing loss and causing negative loss when mask_zero=False and staying at quite big positive loss when mask_zero=True.
The CRF loss (negative log-likelihood; nlogL) is composed of two parts: one is logZ and the other is energy (E; input/emission energy plus chain/transition energy). Among these two, the code computing logZ had a bug related to pad/mask. logZ is computed by recursion and each recursion computes intermediate term logS_k = logsumexp(logS_k-1 - E_k). The final logS_L becomes logZ (L means the length of sequence). The code applies mask to computing E_k but still updates logS_k even for padded inputs and this causes negative loss or big positive loss.
The code computing logS_k is in step() method in crf.py. In this method, the 'if return_logZ' clause had a bug and need to be modified as follows:
        if return_logZ:
            energy = chain_energy + K.expand_dims(input_energy_t - prev_target_val, 2)
            new_target_val = K.logsumexp(-energy, 1)

            **# added from here
            if len(states) > 3:
                if K.backend() == 'theano':
                    m = states[3][:, t:(t + 2)]
                else:
                    m = K.slice(states[3], [0, t], [-1, 2])
                is_valid = K.expand_dims(m[:, 0])
                new_target_val = is_valid * new_target_val + (1 - is_valid) * prev_target_val
            # added until here**

            return new_target_val, [new_target_val, i + 1]

I've checked this solved the issues about negative loss when mask_zero=False and big positive loss when mask_zero=True at Embedding layer. However, this seems to have no effect on the performance of the model learning.

🎉  Congratulations on solving this issue that has been around for so long!

I just found a bug in CRF code, which is related to computing loss and causing negative loss when mask_zero=False and staying at quite big positive loss when mask_zero=True.
The CRF loss (negative log-likelihood; nlogL) is composed of two parts: one is logZ and the other is energy (E; input/emission energy plus chain/transition energy). Among these two, the code computing logZ had a bug related to pad/mask. logZ is computed by recursion and each recursion computes intermediate term logS_k = logsumexp(logS_k-1 - E_k). The final logS_L becomes logZ (L means the length of sequence). The code applies mask to computing E_k but still updates logS_k even for padded inputs and this causes negative loss or big positive loss.
The code computing logS_k is in step() method in crf.py. In this method, the 'if return_logZ' clause had a bug and need to be modified as follows:
        if return_logZ:
            energy = chain_energy + K.expand_dims(input_energy_t - prev_target_val, 2)
            new_target_val = K.logsumexp(-energy, 1)

            # added from here
            if len(states) > 3:
                if K.backend() == 'theano':
                    m = states[3][:, t:(t + 2)]
                else:
                    m = K.slice(states[3], [0, t], [-1, 2])
                is_valid = K.expand_dims(m[:, 0])
                new_target_val = is_valid * new_target_val + (1 - is_valid) * prev_target_val
            # added until here

            return new_target_val, [new_target_val, i + 1]

I've checked this solved the issues about negative loss when mask_zero=False and big positive loss when mask_zero=True at Embedding layer. However, this seems to have no effect on the performance of the model learning.

Are you sure this fixes the problem I added this like you wanted but the problem still persists this is my step function after correction :
   def step(self, input_energy_t, states, return_logZ=True):         # not in the following prev_target_valhas shape = (B, F)         # where B = batch_size, F = output feature dim         # Note:iis of float32, due to the behavior ofK.rnn`
prev_target_val, i, chain_energy = states[:3]
t = K.cast(i[0, 0], dtype='int32')
if len(states) > 3:
if K.backend() == 'theano':
m = states[3][:, t:(t + 2)]
else:
m = K.slice(states[3], [0, t], [-1, 2])
input_energy_t = input_energy_t * K.expand_dims(m[:, 0])
# (1, F, F)*(B, 1, 1) -> (B, F, F)
chain_energy = chain_energy * K.expand_dims(
K.expand_dims(m[:, 0] * m[:, 1]))
if return_logZ:
energy = chain_energy + K.expand_dims(input_energy_t - prev_target_val, 2)
new_target_val = K.logsumexp(-energy, 1)
        # added from here
        if len(states) > 3:
            if K.backend() == 'theano':
                m = states[3][:, t:(t + 2)]
            else:
                m = K.slice(states[3], [0, t], [-1, 2])
            is_valid = K.expand_dims(m[:, 0])
            new_target_val = is_valid * new_target_val + (1 - is_valid) * prev_target_val
        # added until here

        return new_target_val, [new_target_val, i + 1]
    else:
        energy = chain_energy + K.expand_dims(input_energy_t + prev_target_val, 2)
        min_energy = K.min(energy, 1)
        # cast for tf-version `K.rnn
        argmin_table = K.cast(K.argmin(energy, 1), K.floatx())
        return argmin_table, [min_energy, i + 1]`

@lzfelix @pinesnow72


Application merged to a single file as taleDices_full.html added for …

…user comfort

Recently a one file version of this app merged.


Added UMI datasets

I have added 2 different datasets from 2 vendors: they have different read structure and therefore allow testing UMI in both reads or just read 2.

Can you actually add the test data inside the testdata folder: https://github.com/nf-core/test-datasets/tree/sarek/testdata


Add Projects / Project Selector - proposal

May be it's already there and I was unable to find it, but having Projects selectable by the user (and / or may be restricted in config.json) would be a great plus.

Hi, projects are not ready yet. They are in the roadmap, but not yet.

Hi, our all clients are under projects, and it seems that with this UI, you cannot see anything which is under a project. Is there a progress on this one?

@ToniIltanen hello, we have projects in our backlog, but for now this feature is not implemented.


Update from MainActivity to MainApplication README.md

The import is not in MainActivity but MainApplication

Thanks @ErickMaeda !


Add CUDA 11.8 builds

At the beginning of September 2023, conda-forge began a CUDA 11.8 migration: https://github.com/conda-forge/conda-forge-pinning-feedstock/pull/4834
The migration was run for ~4 months before being closed in mid-January 2024 as completed: https://github.com/conda-forge/conda-forge-pinning-feedstock/pull/5340
While nearly all feedstocks were either rebuilt with CUDA 11.8 or had a PR added for CUDA 11.8, there were a handful of feedstocks where a CUDA 11.8 migration PR was not opened. This feedstock was one of them (hence opening this issue to raise awareness about CUDA 11.8)
That said, the global CUDA build matrix includes CUDA 11.8. So simply re-rendering would add CUDA 11.8
Currently this feedstock is building on CUDA 11.2. However that is pending deprecation in conda-forge. Please see this announcement and this issue ( https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/5339 ) for more details
So raising this issue to suggest adding CUDA 11.8 to keep this feedstock update on CUDA and also prepare for the removal of CUDA 11.2

JFYI CUDA 11.2 has now officially been dropped


How do i use this with a Youtube Cast device that isn't a chromecast?

I want to use this with my "smart tv" that has a youtube app and allows casting but isn't a chromecast itself

You should look for something that supports the DIAL (Discovery and Launch) protocol like https://github.com/MarcoLucidi01/ytcast


Retention - use RETURNING to speed up queries

We use RETURNING in some queries to pass it to further queries to avoid fetching entire tables, as suggested in point 1 in https://github.com/zulip/zulip/pull/12356
Note: When archiving UserMessages, we get rid of the realm check - we just archive all usermessages tied to the Messages in the preceding query (which are all expired Messages whose sender is in the realm). This only makes a difference in the case of cross-realm messages. In that case, we will archive the recipient's UserMessages - but this small redundancy shouldn't be a big issue and should be worth the added simplicity. Cross-realm messages will handled properly later anyway.

I posted a few comments after which I'm happy to merge, thanks @mateuszmandera!
Reading this made me realize another thing we should be keeping in mind for the structure of this backend, which is that we'll likely want to batch some of these operations on lists of IDs to only do e.g. 1K at a time to avoid too-large transactions.  We have some example code doing that sort of batching in zerver/lib/soft_deactivation.py (search for BATCH_SIZE).
This doesn't need to happen now (can be later, and might be cleaner to do after we have the rest of the structure in place with per-stream policies), but just wanted to mention it.

Great, merged, thanks @mateuszmandera!


handle timestamps of files/directories so that they don't get updated on each rsync run

As a repository operator I want krill-sync to set a constant timestamp on files so that they do not get modified unnecessarily.
I observe that many RP instances run rsync with flags that sync the timestamp. For example, on my machine, I see the following rsync process:
rsync --contimeout=10 --timeout=300 -rltz --delete rsync://[repo]/repo/ [target_dir]

I think that the times are also used to detect what files are modified, since -c is documented as
        -c, --checksum              skip based on checksum, not mod-time & size

The timestamp of the files in the repository is set to the time the repository is written. I think this causes rsync clients to change the modification time of each file every time rsync is running (and maybe even transfer them).

Right, so you are proposing a fixed, perhaps hardcoded timestamp?
To me it seems a bit wrong to do it this way.. I think it would be better to use one of the following strategies:

use a timestamp based on when krill-sync first sees an object
use a timestamp based on the 'not-before' time of each object (i.e. parse it)

The first is relatively easy on the 0.2 dev branch and probably good enough. The second is perhaps more correct, but will incur a (much) bigger cost in parsing - well and development - and it could lead to issues if an object cannot be parsed (fall back to strategy 1 then?).
The additional cost to setting the mtime (which is what matters here I guess) is negligible I think - seems to add about 10%.
So, all in all my proposal would be to scope this issue to strategy 1 for now - and perhaps create a follow up issue for strategy 2 if it would be needed at all.

Perhaps I misunderstood but I thought Ties meant only that once written, the timestamp of a file (even if deleted and replaced by an identical file) should not change from the perspective of the serving process (rsyncd/nginx) so that it is not mistakenly perceived to have changed when it has not. I do not think he was proposing a single fixed hard-coded timestamp. But I could be wrong...

Ah yes, most likely constant for each file. Anyway, I will look at strategy 1... it should be fairly straightforward when I implement issue #27 - then I will need to keep the current files and their metadata anyway - instead of just getting them from XML.
Strategy 2 can be done as a later improvement.

Indeed - I meant that each file keeps a constant timestamp in each revision of the rsync repository written. My understanding is that rsync without -c may not re-sync files that changed, but kept their size & date, so choosing one fixed point in time would lead to rare bugs.
For the directories you can choose a fixed timestamp. For example, the RIPE repository uses 1-1-1970:
$ rsync rsync://rpki.ripe.net/repository/
...
drwxr-xr-x        4096 2021/06/11 17:01:36 .
-rw-r--r--        1259 2021/05/04 13:31:22 2a7dd1d787d793e4c8af56e197d4eed92af6ba13.cer
-rw-r--r--         555 2021/05/04 13:31:22 ripe-ncc-ta.crl
-rw-r--r--        1796 2021/05/04 13:31:22 ripe-ncc-ta.mft
drwxr-xr-x     1187840 1970/01/01 01:00:00 DEFAULT
drwxr-xr-x        4096 1970/01/01 01:00:00 aca

As an aside: It looks like ETags optionally (and also If-Modified-Since definitely) use the modification time. So if multiple instances run behind a LB, for RRDP, this can also lead to multiple transfers of notification.xml. For If-None-Match with one ETag I'm not even sure if it converges.

Indeed - I meant that each file keeps a constant timestamp in each revision of the rsync repository written. My understanding is that rsync without -c may not re-sync files that changed, but kept their size & date, so choosing one fixed point in time would lead to rare bugs.
For the directories you can choose a fixed timestamp. For example, the RIPE repository uses 1-1-1970:
$ rsync rsync://rpki.ripe.net/repository/
...
drwxr-xr-x        4096 2021/06/11 17:01:36 .
-rw-r--r--        1259 2021/05/04 13:31:22 2a7dd1d787d793e4c8af56e197d4eed92af6ba13.cer
-rw-r--r--         555 2021/05/04 13:31:22 ripe-ncc-ta.crl
-rw-r--r--        1796 2021/05/04 13:31:22 ripe-ncc-ta.mft
drwxr-xr-x     1187840 1970/01/01 01:00:00 DEFAULT
drwxr-xr-x        4096 1970/01/01 01:00:00 aca

My intuition is to stay away from strategy 2 - iirc a repository may contain non-RPKI files.

Sure, aiming for 1.. 2 would only ever work with a fallback to 1.

As an aside: It looks like ETags optionally (and also If-Modified-Since definitely) use the modification time. So if multiple instances run behind a LB, for RRDP, this can also lead to multiple transfers of notification.xml. For If-None-Match with one ETag I'm not even sure if it converges.

Right.. different issue, but replying here.. so far 'If-None-Match' seems to work just fine on the RIPE NCC notification.xml, but then again I hit the CDN and not the back-end servers. The cost of doing an extra fetch from krill-sync is not too bad I would think though - it can work out based on the session and serial that no work is needed.
What I can do is fall back to 'If-Modified-Since' if no 'ETag' was received. According to RFC7232 there is no point in specifying both together: https://datatracker.ietf.org/doc/html/rfc7232#section-3.3
Then.. well if your cluster cannot give me a reliable ETag, perhaps don't set it?

My intuition is to stay away from strategy 2 - iirc a repository may contain non-RPKI files.

Sure, aiming for 1.. 2 would only ever work with a fallback to 1.

And I have gone full circle on this: Consider the situation with multiple nodes behind a load-balancer (as we are likely to do). By default any request can land at any of the machines behind the load-balancer (without considering consistent hashing or rendezvous hashing).
To prevent the modification time changing on all files for every new revision written (as it is right now), the nodes need the same timestamp for each file.
I guess approach (1) can never do that while it is a property of (2).
We use a similar approach for our current repository writing: We take the timestamp the object was 'published at'. Unfortunately RRDP repositories do not contain something like that...

Right.. different issue, but replying here.. so far 'If-None-Match' seems to work just fine on the RIPE NCC notification.xml, but then again I hit the CDN and not the back-end servers. The cost of doing an extra fetch from krill-sync is not too bad I would think though - it can work out based on the session and serial that no work is needed.
What I can do is fall back to 'If-Modified-Since' if no 'ETag' was received. According to RFC7232 there is no point in specifying both together: https://datatracker.ietf.org/doc/html/rfc7232#section-3.3
Then.. well if your cluster cannot give me a reliable ETag, perhaps don't set it?

I was thinking about If-None-Match and ETags for files read from different machines behind a load-balancer (not for krill-sync as a client). I expect there to be many more clients reading from a krill-sync node than requests from krill-sync -> origin.
If you have two machines behind a load-balancer, both would need to have the same modification time and ETag (iff the webserver uses the modification timestamp, which apparently is allowed) for things to work as you expect.
I think I should just write down a draft on some deployment considerations for RRDP and rsync repositories. I do not think these caching issues (as well as the need for 'long-lived consistent copies' instead of atomically consistent rsync repositories) is written down anywhere.

After measuring running this on a copy of the nic.br repository (using local files as input) I found that setting the time based on parsed objects rather than 'now' when the object was first seen, makes next to no difference - it was unmeasurable on my machine.
So in short I figured that we do not need an option for this and krill-sync will just base the mtime on parsed objects. This is still best effort. If parsing an object fails a warning is issued and the time when the object was first encountered is used instead.
Note: we currently do not fix directory times. I believe this is not needed for rsync since it doesn't really care about directories - it synchronises individual files.


Automatically Restart TypeScript Service on TypeScript TSDK Change

VSCode Version: 1.8
OS Version: All

A user on twitter ran into an issue yesterday where VSCode seemed to be reporting the wrong error messages for TypeScript. They had updated their typescript.tsdk setting to point at typescript 2.1.x but were still seeing an error specific to typescript 2.0.x. Restarting VSCode fixed the issue.
We should detect changes to the typescript.tsdk and restart the typescript service automatically if it is updated.

Mostly fixed using new flow from  #19451


TypeError: only size-1 arrays can be converted to Python scalars

when i run   python ./demo_darkfeat.py --input ./fig/DarkFeat/seq-01/ --output_dir ./output --resize 960 640 --model_path ./fig/DarkFeat/DarkFeat.pth
error:
Namespace(force_cpu=False, image_glob=['*.ARW'], input='./fig/DarkFeat/seq-01/', model_path='./fig/DarkFeat/DarkFeat.pth', output_dir='./output', resize=[960, 640])
Will resize to 960x640 (WxH)
Running inference on device "cuda"
Loaded DarkFeat model
==> Processing image directory input: ./fig/DarkFeat/seq-01/
==> Will write outputs to ./output
Traceback (most recent call last):
File "./demo_darkfeat.py", line 108, in
E, inliers, pts1, pts2 = compute_essential(mkpts0, mkpts1, K)
File "./demo_darkfeat.py", line 18, in compute_essential
ransac_model, ransac_inliers = cv2.findEssentialMat(pts1, pts2, K_1, method=cv2.RANSAC, prob=0.999, threshold=0.001, maxIters=10000)
TypeError: only size-1 arrays can be converted to Python scalars

I would really appreciate it if you could tell me which version of opencv you are using？

Hi there,
The version I am currently utilizing is OpenCV 4.6.0.

Thank you for your reply, I can't find the tourism dataset in GL3D's tourism_data.md, if it's convenient for you, please provide the link of the tourism dataset.


sql server compatibility

Can someone provide some basic instructions on how to make this package sql server compatible? Is it just a case of adding a sqlserver function to each macro? TIA

Welcome.  We're excited about the possibility of you making a contribution!
I would recommend waiting until #188 is merged before getting started as it changes some of the fundamentals of how the package works, but once that is done the key things you need to take care of:

Making sure the adapter you're supporting implements the type helpers used in the source models.
Adding overwrites for the custom type helpers if required
If required, creating adapter-specific version of the upload_* macros.
Adding SQLServer CI support

The last one is perhaps the trickiest, as it may involves setting up some infrastructure.  We could potentially use some guidance from the sql server adapter maintainers as to how they've setup testing for their adapter.

Welcome. We're excited about the possibility of you making a contribution!
I would recommend waiting until #188 is merged before getting started as it changes some of the fundamentals of how the package works, but once that is done the key things you need to take care of:

Making sure the adapter you're supporting implements the type helpers used in the source models.
Adding overwrites for the custom type helpers if required
If required, creating adapter-specific version of the upload_* macros.
Adding SQLServer CI support

The last one is perhaps the trickiest, as it may involves setting up some infrastructure. We could potentially use some guidance from the sql server adapter maintainers as to how they've setup testing for their adapter.

For the last point here's a SQL server spun up in CI https://github.com/AutoIDM/autoidm-target-mssql/blob/main/script.sh could tweak this for GH actions

Looks like #188 is merged. I haven't verified, but imagine that the https://github.com/dbt-msft/tsql-utils package will help with the type helpers and upload_* macros. If using that the tsql-utils package, since many dbt utils have been moved to core, you need the following in dbt_project.yml:
dispatch:
  - macro_namespace: dbt
    search_order: ['tsql_utils', 'dbt']
  - macro_namespace: dbt_utils
    search_order: ['tsql_utils', 'dbt_utils']

@jgilfillan I don't have time to implement SQL Server compatibility right now, but can help

name and schema are keywords in SQL Server that must be quoted in queries, either with double quotes (eg. "schema") or square brackets (eg [schema]). Any thoughts on the best way to implement this db-specific syntax within the model scripts?


Multi-paragraph Blockquotes

This is a duplicate of #4, but with a spec.

I'm not really sure how to move this forward as I was trying to assist the moving forward of #4. Closing this for now.

Thanks @bensheldon .


log.error("(x)"): Reference to property x in closure requires explicit self. to make capture semantics explicit

The title says it all 😄
After upgrading from 3.3 to 3.5.1, I get a lots of compile errors like the above (x is a property of self).
Saw it happen with error, warning and verbose.

In earlier versions the closures were marked as @noescape in order to save you from having to write self.. However, this was technically incorrect since the closures do in fact escape (they're passed on to other methods to be executed, they're not executed the debug() method themselves.
Because the closures escape, they need to be able to capture the variable, which is why you need to include self..
I don't know if there's any other way around it, short of duplicating a tonne of code in the library, or executing the closure early, which could mean it would be executed even when the result would be discarded (seems like a bad trade-off to add a performance hit just to avoid extra typing).
If anyone has a solution I'm not seeing, please speak up.

Will reopen if anyone has other suggestions.

Passing a non-escaping closure to another function that takes a non-escaping closure is perfectly legal Swift.

func bar(@autoclosure closure: () -> String) {
    print(closure())
}

func foo(@autoclosure closure: () -> String) {
    bar(closure)
}

class Test {
    let x = 1

    init() {
    }

    func doit() {
        foo("x = \(x)")
    }
}

let t = Test()
t.doit()

Since logln does not make a copy of the closure (for example, using dispatch_async) then no (escaping) attributes are required. I've opened #150 which compiles just fine.

Ok, will change this for the next beta (hopefully out in a few hours). I was probably being overly cautious.

This now on master, swift_2.2, swift_2.3 and swift_3.0 branches. Thanks!

Any idea when this will be released to the pod repo?

Sorry, looks like I broke this again way back in September when merging in a big branch. I've re-fixed it. Currently on the develop branch, will hit master and CocoaPods shortly.


L3uddz patch 1

Following on from #3

@l3uddz Could you please sanity check my work on top of your changes :)


fixed converters/valueToPosition

The fact that this function is still returning a position when value is undefined was causing me an issue in single slider mode as under some conditions (after changing min and max values) it was setting positionTwo equal to max and then I wouldn't be able to slide to the max value.
I think it's better if it returns undefined when value is undefined
please let me know if I'm missing something here :)

Thanks! That’s looks indeed better. Wonder if it should be treated as a breaking change or not.

I'm using this module in my app both as single and multi slider, it's not breaking for me but sure as hell my app doesn't cover all the possible usages.
It is logically sound though, If I am trying to convert an undefined value to a position what am I expecting as a result?


Set up templates

See https://quarto.org/docs/extensions/starter-templates.html for instructions and
https://github.com/grantmcdermott/quarto-revealjs-clean for examples in action.

Need to add instructions for using the templates to README and webpage

Completed


Iteration Plan for June 2021

This plan captures our work in June. This is a 4-week iteration. We will ship in early July.
Endgame

June 28, 2021: Endgame
July 2, 2021: Endgame done

The endgame details for this iteration are tracked here.
Plan Items
Below is a summary of the top level plan items.
Legend of annotations:

Mark
Description

:runner:
work in progress

:hand:
blocked task

:muscle:
stretch goal for this iteration

:red_circle:
missing issue reference

:large_blue_circle:
more investigation required to remove uncertainty

:black_circle:
under discussion within the team

:black_large_square:
a large work item, larger than one iteration

Accessibility

[ ] Accessibility issues, see query @isidorn team
[ ] Assess notebook accessibility https://github.com/microsoft/vscode/issues/111255 @rebornix @isidorn @roblourens

Workbench

[ ] :red_circle: Trusted Folders/Workspaces @lszomoru @sbatten

[ ] :red_circle: Investigate what it means to support the notion of trust for virtual workspaces @sbatten @lszomoru
[ ] :runner: Engagement with extension authors on adoption trusted folders https://github.com/microsoft/vscode/issues/120251 @lszomoru @sbatten

[ ] :runner: Improve the welcome pages https://github.com/microsoft/vscode/issues/106715 @jacksonkearl @misolori @digitarald

[x] Reclaim "Welcome" page for the current "Getting Started" page https://github.com/microsoft/vscode/issues/126419 @jacksonkearl
[ ] :runner: Polish the graphics presented in the out-of-the-box walkthroughs https://github.com/microsoft/vscode/issues/125877 @daviddossett @digitarald
[x] Polish how the user can manage the tiles on the welcome page https://github.com/microsoft/vscode/issues/126420 @JacksonKearl @misolori
[ ] :red_circle: Improve presentation of new tiles and presentation of a larger number of tiles @JacksonKearl @misolori
[ ] :runner: Continue user testing on new welcome pages https://github.com/microsoft/vscode/issues/125117 @digitarald
[ ] :runner: Explore Extension content contributions https://github.com/microsoft/vscode/issues/118402 @digitarald
[ ] :muscle: Enable a walkthrough based on the files in the workspace https://github.com/microsoft/vscode/issues/121778 @jacksonkearl

[ ] :muscle: Explore consolidated presentation of release notes and change logs, see also https://github.com/microsoft/vscode/issues/123906 @jacksonkearl @misolori @digitarald
[ ] :runner: Explore universal, extensible "New..." to make it easier to create new files or notebooks, see also https://github.com/microsoft/vscode/issues/124304 @JacksonKearl @misolori
[x] :runner: Add support for detail messages in notifications/dialogs https://github.com/microsoft/vscode/issues/125750 @jrieken
[ ] :runner: Add support for rich hovers in statusbar items https://github.com/microsoft/vscode/issues/126258 @aeschli
[ ] :runner: Add support for drag&drop in custom trees https://github.com/microsoft/vscode/issues/32592 @alexr00
[ ] :runner: Allow opening all new editors in a dedicated editor group https://github.com/microsoft/vscode/issues/124709 @bpasero @misolori
[ ] :runner: Improvements to the setting editor https://github.com/microsoft/vscode/issues/77458 https://github.com/microsoft/vscode/issues/125958 https://github.com/microsoft/vscode/issues/79571 https://github.com/microsoft/vscode/issues/126089 @rzhao271
[x] :runner: Disable dependent extension if one of its dependency is disabled https://github.com/microsoft/vscode/issues/122448 @sandy081
[ ] :muscle: Add support for rich hovers in the Extensions view https://github.com/microsoft/vscode/issues/126479 @sandy081
[ ] :muscle: Improve rendering of Extensions Viewlet when the width is narrow https://github.com/microsoft/vscode/issues/118511 @sandy081
[x] :runner: Settings sync: Provide easier access to the logs https://github.com/microsoft/vscode/issues/125687 @sandy081

Web

[ ] Improve iPad support (keyboard/trackpad/mouse and touch) query @isidorn

UX

[ ] :runner: Explore how to cycle through inline completion proposals @misolori @hediet
[ ] :red_circle: :runner: Explore how to cycle through inline completion proposals @misolori @hediet
[ ] :muscle: Continue exploration of profiles https://github.com/microsoft/vscode/issues/116740 @misolori
[ ] :muscle: :red_circle: Explore improvements to the end-to-end experience of opening your first Jupyter notebook @misolori team

Code Editor

[ ] :runner: Improve inline completion support query @hediet
[ ] :runner: Improve editor decoration support (move away from using CSS ::after) root cause of https://github.com/microsoft/vscode/issues/125123 and other issues @hediet @alexdima
[x] Publish a new Monaco editor release @hediet

Notebooks
Notebook Editor

[ ] :red_circle: :runner: Improve discoverability of notebook layout and behavior customizability @misolori @rebornix @roblourens
[ ] :runner: Improve rendering jitter in notebooks https://github.com/microsoft/vscode/issues/126432 @roblourens @mjbvz
[ ] :runner: Fully support markup rendering in notebooks https://github.com/microsoft/vscode/issues/126417 @mjbvz
[ ] :runner: Reduce notebook papercut issues https://github.com/microsoft/vscode/issues/113245 @rebornix @jrieken @roblourens
[ ] :hand: Stabilize APIs for notebook change events https://github.com/microsoft/vscode/issues/125758 @jrieken
[ ] Finalize renderer API https://github.com/microsoft/vscode/issues/123601 @connor4312
[ ] :muscle: Collect needs/requirements for marketplace to support notebook content provider and renderers suggestions https://github.com/microsoft/vscode/issues/123581 @rebornix
[ ] :muscle: Overview ruler https://github.com/microsoft/vscode/issues/96442 @rebornix

Jupyter Notebooks

[ ] :runner: Replace the webview-based interactive window with a built-in one https://github.com/microsoft/vscode/issues/126415 @rebornix @joyceerhl
[ ] :runner: Explore debugging in Jupyter notebooks (line-by-line versus full debugging support) https://github.com/microsoft/vscode/issues/126431 @roblourens @weinand @DavidKutu

Authentication

[ ] :runner: Improve GitHub auth provider query @tylerleonhardt

Install

[ ] :red_circle: winget: support updates of the VS Code Insider release @lszomoru

Languages

[ ] :runner: Finalize support for richer completion item detail rendering https://github.com/microsoft/vscode/issues/39441 @jrieken

LSP /LSIF

[ ] :runner: LSP - Collaborate on "TypeHierarchy" support with the Java extension team @dbaeumer Java team https://github.com/microsoft/language-server-protocol/pull/1231
[ ] :runner: LSP - Add support for a pull model for diagnostics https://github.com/microsoft/language-server-protocol/issues/737 @dbaeumer

JavaScript/TypeScript

[ ] :runner: Explore improving zero-knowledge onboarding into a well-tuned TS setup (tasks, tests, debugging, etc.) https://github.com/microsoft/vscode/issues/121345 @jacksonkearl @connor4312 @mjbvz @misolori

Python

[ ] :red_circle: :runner: Explore support for untrusted folders @brettcannon
[ ] :runner: Explore improvements to the debugging experience https://github.com/microsoft/vscode/issues/126463 @weinand @isidorn @luabud

Debug

[ ] :runner: Improve editor run action by using the new split button https://github.com/microsoft/vscode/issues/117722 @weinand @isidorn
[ ] Investigate support for setting a value in the Watch view https://github.com/microsoft/vscode/issues/115063 @weinand @isidorn
[ ] :muscle: :runner: Investigate in UI for debugging highly concurrent languages https://github.com/microsoft/vscode/issues/116109 @weinand
[ ] :muscle: Explore integration of a memory inspector : https://github.com/microsoft/vscode-js-debug/issues/1008 @connor4312

DAP

[x] :runner: Support for a new WriteMemoryRequest if debuggee permits to https://github.com/microsoft/debug-adapter-protocol/issues/163 @weinand
[ ] :runner: Add new Memory Event to refresh an address range https://github.com/microsoft/debug-adapter-protocol/issues/194 @weinand

Testing

[ ] :runner: Provide consolidated testing support https://github.com/microsoft/vscode/issues/107467 @connor4312 @sandy081
[ ] :runner: Finalize testing APIs https://github.com/microsoft/vscode/issues/122208 https://github.com/microsoft/vscode/issues/117379 @connor4312 @jrieken @mjbvz
[ ] Explore APIs for test coverage https://github.com/microsoft/vscode/issues/123713 @connor4312

Terminal

[ ] :runner: Support Terminals in editor tabs https://github.com/microsoft/vscode/issues/10546, https://github.com/microsoft/vscode/issues/125514 @tyriar @meganrogge @bpasero

Source Control

[ ] Explore UI additions to help guide users to push to a remote after committing https://github.com/microsoft/vscode/issues/110882 @eamodio

API

API finalization: query
API proposals: query
[x] :runner: Collaborate with extension authors to adopt the new statusbar id and name properties API @bpasero

Extension Contributions

[ ] Improvements to the Remote extensions https://github.com/microsoft/vscode-remote-release/issues/5183 @alexr00 @roblourens @chrmarti
[ ] :runner: Improvements to the GitHub PR extension https://github.com/microsoft/vscode-pull-request-github/issues/2775 @alexr00
[ ] :runner: Remote Repositories extension https://github.com/microsoft/vscode-remote-repositories-github/issues/12 @eamodio @JacksonKearl @alexr00

Engineering

[ ] :runner: Search editor: leverage text file model support and behave like normal text editors https://github.com/microsoft/vscode/issues/118947 @jacksonkearl
[ ] :runner: Support searching in iframe https://github.com/microsoft/vscode/issues/96307 @rzhao271
[ ] :runner: Switch to using untyped editor inputs externally for better lifecycle management https://github.com/microsoft/vscode/issues/124351 @lramos15
[ ] Add untitled resource support to override service https://github.com/microsoft/vscode/issues/124352 @lramos15

Builds

[ ] :runner: Finish language packs builds https://github.com/microsoft/vscode-loc-drop/issues/51 https://github.com/microsoft/vscode-loc/issues/286 @tylerleonhardt

Electron

None.

Node.js-free, sand-boxed renderer

[ ] :runner: Backlog https://github.com/microsoft/vscode/issues/92164 @bpasero @deepak1556 @rzhao271

Deferred

None.

https://github.com/microsoft/vscode/issues/52855

Hi @Tyriar, @meganrogge
Thank you for the work on terminal editors, day after day the experience is more and more polished. ☺
Today playing with the latest insiders I encountered a weird bug.
Playing with splitted editors, one terminal on the left and one on the right and using the term listing panel to switch from one to another, the terminal is completely broken.
I'm sorry that I am unable to do a screenshot at the moment (no laptop).
Steps to reproduce :

Open latest insiders
Create new terminal editor
Split it using editor split button on top right.
Switch from one terminal to the other (several times) using CMD+P term listing.

I hope that my message is clear enough. If not don't hesitate to tell me, and I'll do a video for you on Monday.


build_ressource: conditions hash mess with user params/default value

Steps to reproduce
Given the following:
class Boat; end

class Ability
  include CanCan::Ability

  def initialize(super_user: false)
    can :create, Boat if super_user
  end
end

Ability.new(super_user: true).attributes_for(:create, Boat) is empty ({}), so in a create route, @boat is initialized using params only
If we had a new boolean attribute slow to Boat, which defaults to false, and add the following so that normal user can only create slow boats:
class Boat; end

class Ability
  include CanCan::Ability

  def initialize(super_user: false)
    can :create, Boat if super_user
    can :create, Boat, slow: true
  end
end

Now Ability.new(super_user: true).attributes_for(:create, Boat) => {slow: true}, so any boat created by a super user, unless explicitly set otherwise, is now slow. This is because load_ressource initializes @boat using a combination of params and attributes_for.
Expected behavior
🤷♂. I don't see a good solution for this. It seems to be built this way, so maybe a doc warning?
Overall I find the use of conditions hash in build_ressource for create routes to be misleading as it messes with user params/default values.
Side question: would a PR to add an option to load_ressource/load_and_authorize_ressource which disables this behavior be accepted, or are we encouraged so bypass load_ressource?
System configuration
Rails version:
6.0.0
Ruby version:
2.5.5
CanCanCan version
3.0.1

The option to restrict params using hash conditions is really useful and it makes sure that no one does/create something that they are not suppose to do (That's the whole point of authorization). For your case a better approach would be to use the following:
def initialize(super_user: false)
  can :create, Boat if super_user
  can :create, Boat, slow: true if !super_user    # Or unless super_user
end

# Or

def initialize(super_user: false)
  if super_user
    can :create, Boat
  else
    can :create, Boat, slow: true
  end
end

CCC v3.1.0. Ran into a similar case as the OP, with similar confusion. Now trying to understand how ability composition should be expected to work. Given this...
can :new, Foo, bar: 22
can :new, Foo, bar: 33

...I'd expect a new Foo with {bar: 33} in my #new action. But it blows up with '401 Unauthorized'.
Given this...
can :new, Foo, bar: 22
cannot :new, Foo
can :new, Foo, bar: 33

...I'd again expect a new Foo with {bar: 33} in my #new action. It doesn't blow up, but :bar is 22.
The docs say that successive 'can' rules are OR'ed together, which is cool for most things, but it's not making sense to me in the context of #new/#create.
I realize that conditionals may sometimes be used to achieve the intent in cases like these, but still, we're leaning on CanCanCan more and more in our project (thank you, by the way), and I'd like to be able to read an ability file with some fluency. What's the internal logic at play that explains the behavior here?
Thanks for any insight!

Would be possible to get a gist to reproduce the issue? I am not sure I fully understood your use case.


Auto-attach with data-simplebar does not work in Chrome, IE11, Edge on Windows

Appending data-simplebar to the element is not enough to attach the scrollbar to Chrome, IE11 and Edge on Windows, while it does work for Firefox. I need to add new SimpleBar(el) to get it to attach in those browsers.

I can't reproduce this issue (I'm testing using Browserstack). Could you tell me what exact version of Chrome for ex this is happening? Or maybe a jsfiddle where I can experience this issue?
Thanks!

Upon further inspection, the problem is slightly more complex than I thought. The issue is that I load simplebar with the async attribute. Apparently, Firefox handles async scripts differently from Chrome, IE11 and Edge.
More specifically, the issue appears to be that the DOMContentLoaded event has already fired before simplebar has the chance to register the event listener.
jQuery and other libraries deal with this problem like by querying the document.readyState [1].
[1] http://stackoverflow.com/questions/9237044/async-loaded-scripts-with-domcontentloaded-or-load-event-handlers-not-being-call

Okay that makes sense, should be fairly easy to fix.
Thanks for this!

You're welcome, happy to help improve an already awesome 🥇 library!


Stop adding timestamp and duration to spans at ingest

ApplyTimestampAndDuration was a stop-gap measure created to allow a duration query on spans created by old instrumentation. This causes problems, such as #1280, when server spans arrive before client ones.
The correct approach to the timestamp duration problem is to have instrumentation projects update themselves to support these fields, as opposed to guessing incorrectly at ingest time. Here are docs on how to do this https://github.com/openzipkin/openzipkin.github.io/pull/46

PS the impact to this is that if instrumentation projects don't update, the duration query won't work. This is a better problem than changing spans to have the wrong timestamp, especially as instrumentation have had 10 months time to start updating.

this is crappier than I thought since when spans don't set timestamp, and we don't derive one, we could end up not indexing them at all. Dirty as it is, we may have to use an imperfect heuristic until instrumentation projects log span.timestamp

fix on the way

here's the fix https://github.com/openzipkin/zipkin/pull/1282


Error ShapeSource.tsx: Unknown node type: "TSInstantiationExpression"

Environment

Dev OS: OSX

Steps to reproduce
Follow exact installation guide from: https://github.com/rnmapbox/maps/blob/main/android/install.md
when compiling getting error while compiling:
error<EMAIL_ADDRESS><EMAIL_ADDRESS>Unknown node type: "TSInstantiationExpression"
build.gradle
``
buildscript {
ext {
buildToolsVersion = "31.0.0"
RNMapboxMapsImpl = "mapbox"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 31
googlePlayServicesVersion = "17.0.0"
    if (System.properties['os.arch'] == "aarch64") {
        // For M1 Users we need to use the NDK 24 which added support for aarch64
        ndkVersion = "24.0.8215888"
    } else {
        // Otherwise we default to the side-by-side NDK version from AGP.
        ndkVersion = "21.4.7075529"
    }
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle:7.0.4")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("de.undercouch:gradle-download-task:4.1.2")
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}
``
here is my package.json
package.json
{
  "name": "iHuniDbkk",
  "version": "1.0.0",
  "description": "iHuni app for DBKK",
  "author": "EASB",
  "homepage": "https://elegantaspire.com/",
  "private": true,
  "scripts": {
    "android": "yarn android:adb && npx react-native run-android",
    "android:release": "yarn android --variant release",
    "android:adb": "adb reverse tcp:8081 tcp:8081",
    "ios": "npx react-native run-ios",
    "ios:device": "react-native run-ios --device=\"iPhone 12 Pro\"",
    "ios:release": "yarn ios --configuration Release",
    "ios:pods": "npx pod-install",
    "ios:pods:ru": "cd ios && pod install --repo-update && cd ..",
    "start": "npx react-native start",
    "start:rc": "npx react-native start --reset-cache",
    "rename": "npx react-native-rename",
    "test": "jest",
    "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
    "format": "prettier --check ./src",
    "format:write": "prettier --write ./src",
    "release": "dotenv release-it",
    "postinstall": "patch-package"
  },
  "dependencies": {
    "@gorhom/bottom-sheet": "^4.4.6",
    "@kanzitelli/if-component": "^0.3.0",
    "@react-native-async-storage/async-storage": "^1.16.2",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/datetimepicker": "^6.7.5",
    "@react-native-community/netinfo": "^9.3.10",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/native-stack": "^6.5.0",
    "@rnmapbox/maps": "^10.0.11",
    "date-fns": "^2.28.0",
    "formik": "^2.2.9",
    "i18n-js": "^3.8.0",
    "lodash": "^4.17.21",
    "lottie-react-native": "^5.1.6",
    "mobx": "^6.4.2",
    "mobx-persist-store": "^1.0.6",
    "mobx-react": "^7.3.0",
    "moment": "^2.29.4",
    "react": "17.0.2",
    "react-native": "^0.68.7",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "^2.12.0",
    "react-native-get-random-values": "^1.9.0",
    "react-native-image-picker": "5.1.0",
    "react-native-image-viewing": "^0.2.2",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-maps": "^1.7.1",
    "react-native-mmkv": "^2.2.0",
    "react-native-mmkv-flipper-plugin": "^1.0.0",
    "react-native-modal-datetime-picker": "^16.0.0",
    "react-native-permissions": "^3.8.1",
    "react-native-reanimated": "^3.3.0",
    "react-native-restart": "^0.0.24",
    "react-native-safe-area-context": "^4.5.3",
    "react-native-screens": "^3.13.1",
    "react-native-svg": "^13.9.0",
    "react-native-svg-transformer": "^1.0.0",
    "react-native-toast-message": "^2.1.6",
    "react-native-ui-lib": "^7.6.0",
    "react-native-vector-icons": "^9.1.0",
    "rn-bounceable": "^1.1.0",
    "uuid": "^9.0.0",
    "yup": "^1.1.1"
  },
  "devDependencies": {
    "@babel/cli": "^7.22.9",
    "@babel/core": "^7.12.9",
    "@babel/plugin-proposal-decorators": "^7.22.7",
    "@babel/plugin-transform-react-jsx": "^7.19.0",
    "@babel/preset-typescript": "^7.12.7",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "2.0.0",
    "@tsconfig/react-native": "^1.0.4",
    "@types/i18n-js": "^3.8.2",
    "@types/jest": "^27.4.1",
    "@types/lodash": "^4.14.180",
    "@types/react": "^17.0.40",
    "@types/react-native": "^0.67.3",
    "@types/react-native-vector-icons": "^6.4.10",
    "@types/react-test-renderer": "^17.0.1",
    "@typescript-eslint/eslint-plugin": "^5.15.0",
    "@typescript-eslint/parser": "^5.15.0",
    "babel-jest": "^27.5.1",
    "babel-plugin-module-resolver": "^4.1.0",
    "dotenv-cli": "^5.0.0",
    "eslint": "7.32.0",
    "eslint-plugin-prettier": "3.3.1",
    "jest": "^27.5.1",
    "metro-react-native-babel-preset": "^0.67.0",
    "patch-package": "^6.4.7",
    "postinstall-postinstall": "^2.1.0",
    "prettier": "^2.5.1",
    "react-native-flipper": "^0.198.0",
    "react-test-renderer": "17.0.2",
    "release-it": "^14.12.5",
    "typescript": "^5.1.6"
  },
  "keywords": [
    "react",
    "react-native"
  ],
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
  },
  "license": "MIT"
}

Hi, thanks for the report! To be able to look into setup related issues we need full steps to reproduce the issue.
Ideally n a brand new project, in the form of
react-native init sample --version<EMAIL_ADDRESS>cd sample
npm install @rnmapbox/maps --save
cd ios
pod installl
...
react-native run-ios

closing the issue now, will reopen when you provide the steps to reproduce.
If you cannot reproduce with a  brand new project, please start a new project with the same rn version you have and compare package.json for different versions.
Please note that your issue is considered a support request and we don't provide free support.


Insiders icon missing edge in installer.

Windows
Testing #33272
The icon in the top of the installer is different that Code itself:

Really just in this case a consistency issue.

"by design" at this size we dont use the box.


CNV-41526: Remove ssh servie creation from customize IT

📝 Description
Adjusting customize IT flow to not include sshe service creation , same as instance type quick flow and template flows.
🎥 Demo
After:

Before:

/cherry-pick release-4.16

/cherry-pick release-4.16


err to conect in windows

the pass is't correct and the retur say it is correct
i put the incorrect pass and it say conected but don't realy conect
i use the examples in npmjs wep
version 2.0.4
Intel(R)Dual Band Wireless-Ac 3165

and i test node-wifi-dualband and its the same result

Hi,
It is very painful because it seems to depend of the version of window. What is your version ?


[APIM 3.0.0] Add a confirmation when deprectaing an API

Deprecating an API is a non reversible action. Hence, IMO it is good to put a confirmation, to avoid any unintended deprecation.

Duplicate https://github.com/wso2/product-apim/issues/6243


AdvertisementReceived event always gives e.Device null

Code below throws an exception because e.Device is null.
Scan works and advertisement event is rised when MY_DEVICE_NAME is found, but I'm stuck there...  can this be a bug?
    private async void ScanButton_Click(object sender, EventArgs e)
    {
        Bluetooth.AdvertisementReceived += Bluetooth_AdvertisementReceived;
        bluetoothLEScan = await Bluetooth.RequestLEScanAsync();
    }

    private async void Bluetooth_AdvertisementReceived(object sender, BluetoothAdvertisingEvent e)
    {
        Console.WriteLine($"Name:{e.Name} Rssi:{e.Rssi}");

        if (e.Name == "MY_DEVICE_NAME")
        {
            await e.Device.Gatt.ConnectAsync();
            var servs = await e.Device.Gatt.GetPrimaryServicesAsync();
        }
    }

Anyone experiencing this same issue?
I'm using .NET 4.6.1 on Windows 10. If any additional information is required, please advise.

Hi, I've looked at this with a couple of devices and it does return a BluetoothDevice however it may depend on the advertising device and the type of Bluetooth address in the native advertisement. If it's Unspecified then no address is exposed and if it is Random then Windows may not return a device object from the address. I need to see if in some cases there should be a "fake" BluetoothDevice which contains the random device address. What kind of device are you watching advertisements from?

Thanks for your quick reply.
I'm testing using two different BLE devices. One is a custom product I'm developing over an ESP32, advertising with public address, and the other is a temperature sensor.
Both cases are returning null device (and also some unknown devices that are picked up from the surrounding also return null device).
Additionally, I've downloaded IPWorks BLE demo and sucessfully connected to both devices on the same Windows machine and .NET framework. I know they are different things, but just to add information in case you find it useful to diagnose.
Thank you.

I have the same problem, I hope it can be solved

device :lairpods

device :airpods

I find that if I use“ Windows.Devices.Bluetooth ”The Bluetooth address is random too.
`  private static BluetoothLEAdvertisementWatcher bluetoothLEAdvertisementWatcher;
    public static void Read()
    {
        bluetoothLEAdvertisementWatcher = new BluetoothLEAdvertisementWatcher();
        bluetoothLEAdvertisementWatcher.Received += OnAdvertisementReceived;
        bluetoothLEAdvertisementWatcher.Start();

    }

    private static async void OnAdvertisementReceived(BluetoothLEAdvertisementWatcher watcher, BluetoothLEAdvertisementReceivedEventArgs eventArgs)
    {

        var manufacturerSections = eventArgs.Advertisement.ManufacturerData;

        if (manufacturerSections.Count > 0 )
        {
            var manufacturerData = manufacturerSections[0];
            if (manufacturerData.CompanyId == 76)
            {
                if (manufacturerData.Data.Length == 27)
                {
                    var data = new byte[manufacturerData.Data.Length];
                    using (var reader = DataReader.FromBuffer(manufacturerData.Data))
                    {
                        reader.ReadBytes(data);
                        Console.WriteLine(eventArgs.BluetoothAddress.ToString("x8"));
                        parseData(byteToHexStr(data));
                    }
                }
            }

        }
    }`

Ask a question about Bluetooth protocol. If it's random, how can I confirm who sent it？

If you use its Bluetooth library on Android, it becomes very simple.
  @Override                 public void onScanResult (int callbackType, ScanResult result) {                     try {                         byte[] data = Objects.requireNonNull(result.getScanRecord()).getManufacturerSpecificData(76);
It's easy for me to know which device send "manufacturer specific data"

It's 2024 and this issue still exists on my windows WPF project using a custom IOT Bluetooth project. Works fine for other non-windows implementation. Are we getting a fix?

A quick response to this inquiry would be really kind.
Thank you


[$500] The tricky emoji in the title and description seems to be inconsistent.

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Version Number: <IP_ADDRESS>
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Issue found when executing PR https://github.com/Expensify/App/pull/31259
Action Performed:

Go to staging.new.expensify.com
Log in with any account
Click on Plus button - Assign Task
Input with emojis, especially tricky ones (e.g. 😶🌫, 🏴),

Expected Result:
The tricky emoji in the title and description should be consistent.
Actual Result:
The tricky emoji in the title and description seems to be inconsistent.
Workaround:
Unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[x] Android: Native
[x] Android: mWeb Chrome
[x] iOS: Native
[x] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

Screenshots/Videos
Add any screenshot/video evidence

https://github.com/Expensify/App/assets/93399543/434d4066-36cf-44f3-b6ae-dd682dc7d1e1
View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~012ade86ce4ff9db84
Upwork Job ID:<PHONE_NUMBER>698370048
Last Price Increase: 2023-11-22

Proposal
Please re-state the problem that we are trying to solve in this issue.
Certain emojis looks different when displayed on title and description when assigning a task.
What is the root cause of that problem?
The problem is because description, when rendered in the confirm task screen, is rendered using RenderHTML.
https://github.com/Expensify/App/blob/1eb1f7259bb8e45c1aad3a040539ce367178090b/src/components/MenuItem.js#L276-L278
RenderHTML, when setting the font family of a text, only sets to ONE family, as per their documentation

CSS font-family and font properties allow a comma-separated list of fonts, but React Native styles fontFamily allows only one font name. With the TRE, you can instruct which fonts are available in the system (or fonts you have added), and it will pick the first match! The prop to achieve that is systemFonts.

This causes the app to drop two emoji related fronts when rendering on the web, causing this inconsistency. Inspecting the title element on the web, we see the following font-family:
    font-family: ExpensifyNeue-Regular, "Segoe UI Emoji", "Noto Color Emoji";

But if you inspect the element on the description, we see this:
    font-family: ExpensifyNeue-Regular;

It did drop the other two fonts, which causes emojis to look different on certain platforms.
What changes do you think we should make in order to solve the problem?

As mentioned above, using only one font is the expected behavior as stated in their documentation. To remedy that, I propose we wrap all emojis on the text with <emoji></emoji> tags and then create a custom renderer for this custom tag that will wrap it in a <Text> component, which ensure proper font families are set.
Wrapping emojis with a custom tag can be implemented here:
https://github.com/Expensify/App/blob/1eb1f7259bb8e45c1aad3a040539ce367178090b/src/components/MenuItem.js#L127-L138
And the renderer would look like this:
function EmojiRenderer(props) {
    return <Text>{props.tnode.data}</Text>;
}

export default {
    // Standard HTML tag renderers
    a: AnchorRenderer,
    code: CodeRenderer,
    img: ImageRenderer,
    emoji: EmojiRenderer, // new custom renderer

    // Custom tag renderers
    edited: EditedRenderer,
    pre: PreRenderer,
    'mention-user': MentionUserRenderer,
    'mention-here': MentionHereRenderer,
};

This will force all emojis to be wrapped in <span> with the correct font-family applied.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

Proposal
Updated
Added more information to the proposal as well as screenshots of before and after solution.

Proposal
Please re-state the problem that we are trying to solve in this issue.
The tricky emoji in the title and description seems to be inconsistent
What is the root cause of that problem?
After some deep investigation, I was able to find the real root-cause.
As per the documentation what we did is we provided custom font styles here https://github.com/Expensify/App/blob/e87d35d8af177df33c4fdfbf221ead732efec310/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js#L73
Here we're only providing the simple font i.e ExpensifyNeue-Regular which doesn't contain the font required to render the fonts.
Ref1:
https://github.com/Expensify/App/blob/bf35c29b74e548b9fa7128e51658df039fb6d492/src/styles/fontFamily/multiFontFamily.ts#L11
Ref2:
https://github.com/Expensify/App/blob/df377f22e5820e6e524b065360e186f77a8e9625/src/styles/fontFamily/singleFontFamily.ts#L7
The font-family inside Ref2 we're passing it here https://github.com/Expensify/App/blob/e87d35d8af177df33c4fdfbf221ead732efec310/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js#L70
So to put things into perspective, we need to update the font-style we're passing to the RenderHTML component which should contain the font-family of emojis to.

We should also need to update styles according to os which we're doing in multiFontFamily.ts

Even after adding the emoji font-family this issue won't be solved, because the underlying the HTMLEngine is stripping the font-family we're passing and only taking the first font-family we pass.
https://github.com/native-html/core/blob/4c37d2915feb8c071d060b08d54f5ef5fd9c9afc/packages/css-processor/src/validators/LongFontFamilyPropertyValidator.ts#L5-L22
The above code-snippet that is responsible for passing fontFamily css prop to the Text component.
If we observe the code carefully, the code split the font-family with comma , as a separator and check if the font is supported or not.
While checking the font is supported or not, by default every string is supported, we return the string.
Means if we have font-family ExpensifyNeue-Regular, Seoge UI Emoji the code block will just return ExpensifyNeue-Regular which doesn't give the OP we wanted.
https://github.com/native-html/core/blob/4c37d2915feb8c071d060b08d54f5ef5fd9c9afc/packages/css-processor/src/default.ts#L38-L40
What changes do you think we should make in order to solve the problem?
Patch with our App repo.
Fix
Since React Native only supports one font-family, but web-browser does and as this issue only occurs in Windows (tried in mac, but never was able to repro)
We have two function that returns the font value normalizeRawInlineCSSValue and normalizeNativeValue
We can update the code detect if the environment it's running is weather the runtime is browser or application.
If the environment is application we can leave the code as is, or the environment is browser we could simply return the value which will return all the font-family.

What alternative solutions did you explore? (Optional)
NA
https://github.com/Expensify/App/assets/57614947/b99ae4e3-9177-4f17-badc-aea0bec15068

Proposal
Please re-state the problem that we are trying to solve in this issue.
The tricky emoji in the title and description seems to be inconsistent.
What is the root cause of that problem?
It is a regression from https://github.com/Expensify/App/pull/29158.
https://github.com/Expensify/App/blob/0b0518dde95d35f786fbf918a3b6e99424e0c6fa/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js#L73
We inputed singleFontFamily in systemFonts prop of TRenderEngineProvider component.
This means it will ignore alternative font families for emojis, while rendering text by react-native-render-html library.
It will only use first font family. For example, ExpensifyMono-Regular.
This is why we see inconsistency of emoji in some devices, if the emoji is rendered by react-native-render-html library.
And in reproduction steps of this issue, the description with emoji is rendered by RenderHTML component using react-native-render-html library.
What changes do you think we should make in order to solve the problem?
https://github.com/Expensify/App/blob/0b0518dde95d35f786fbf918a3b6e99424e0c6fa/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js#L82
We can add alternative font families by adding custom HTML render to htmlRenderers variable.
https://github.com/Expensify/App/blob/0b0518dde95d35f786fbf918a3b6e99424e0c6fa/src/components/MenuItem.js#L137
Since the text with emojis is wrapped by <comment> tags, I think we can add a custom render for this. For example, CommentRenderer.
I don't think we need to add extra tags to wrap emojis because it might cause another regression.
For example, if the user selects the text which contains emojis and copy & paste it, extra tags might be pasted too.
What alternative solutions did you explore? (Optional)
N/A

Proposal
Updated
Updated proposed location for wrapping emojis in a tag from MenuItem to the RenderHTML component itself as to encapsulate the logic in it, allowed for reusability and preventing possible side effects.

Proposal
Updated
Turns out there's a much simpler way to get this to work without creating new tag is custom renderers. its just a matter of setting the right defaultTextProps.

Proposal
Updated
Back at my original proposal, forcing font-family on all text nodes caused problems with code blocks and possibly other places.

Based on https://github.com/Expensify/App/issues/31393#issuecomment-1817182124, should this be closed too?

I believe this one is a little different in the sense that it affects the RenderHTML component in general, which is used in several other places around the app, not only the field described in the issue.

I also think that this issue is different. https://github.com/Expensify/App/issues/31393 was specifically about expiration date and CVV fields which weren't important/useful to fix because banking data does not contain emojis so emojis shouldn't even be entered into those fields. The issue here is referring to tasks. Tasks can be created with emojis as there is no reason to prevent their entry so I think this can be fixed. If we can create a solution that will fix this for all fields in the app, even better.

Fixing it in the RenderHTML component should fix it everywhere in the app, including report comments (which also have the same issue, entering the combination below will trigger the issue).
`something`😶🌫

Nice, sounds like we have a plan! Do we have a proposal that would do this? @robertKozik

Sprry for keeping you waiting. Looking into proposals 👀

Proposal
Updated
I just added a new alternative approach to my proposal, to create a web specific component that would patch the element's fontFamilies after render.

Is there any reliable way of reproducing it either on mac or emulators? I've tried on OSX/chrome and android emualtor with no luck:

@robertKozik On desktop, I manually installed the "Noto Color Emoji" font on my Mac and I can reproduce it on Chrome.

Thanks @barros001 is there any additional step after Noto Color Emoji instalation?

As far as I remember, I just installed it and restarted chrome. Before I installed the font, my emoji looked like this on both Chrome and Safari.

After it looked like this:

As stated in react-native-render-html multiple font families are not working on react-native. So I believe this bug is web-exclusive, moreover it looks like it is very hard to reproduce on Macs as we need to manually install specific font... I'll be glad if someone would check me if I'm thinking right on this statements:

Bug can be described as windows web specific
Until now applying specific emoji font family worked only on web, especially on windows as on mac we need to install font family

@robertKozik i believe you are correct.

Native mobile are not affected as they can’t have multiple fonts in the first place.
Mac does not have any of the extra fonts installed and for this reason it’s not really an issue unless someone installs it (could happen but not the base case)
Mobile web seems to not be a problem either as androids default emoji font is already one of the extra fonts. Having it explicitly or not makes no difference. IOS doesn’t have them, same as above.
I do not have windows but it appears the original video on this issue was recorded on windows. Maybe windows does have one of the extra fonts but it’s not the default for emojis? That would explain it.

I’m curious as to why exactly we have the 2 extra emoji fonts. Understanding the reasoning behind that could help us better understand the impact here.

This can be the reason why we specify them: https://github.com/Expensify/App/blob/edcf8f8352dc5e80b07a249658c6fada0e88e180/src/styles/fontFamily/multiFontFamily.ts#L6-L7

@robertKozik I see, so looks like it really only affects windows and Ubuntu users for the most part. Let me know your thoughts on my proposal. I kinda like the alternate proposal as it doesn’t involve any new elements being added which could potentially cause regressions, although it might look a little hacky.

I see that you consider fixing upstream as well @barros001 . I can't see any details about that approach and I'm wondering whether It would be a difficult task prone to regressions inside lib itself as I can imagine that it can be assumed the font will be single after validator runs on it.

Yeah, It's clear to me that there is no ideal solution for this situation. I'll approve your proposal to get a fresh pair of internal eyes on this issue.
In my opinion patching this scenario upstream won't be an option as it is clearly stated as design choice of react-native-render-html and your solution should we quite efficient to cope with this problem without regressions.
But what bothers me is that problem could be quite niche and to actually cope with it we need to not so efficiently patch the html before rendering. To be honest I would actually opt for closing this issue as it requires very specific setup for reproduction on mac, and only occurs on windows.
🎀 👀 🎀 C+ reviewed

Proposal
Updated
@robertKozik I just modified my proposal to add yet another alternate solution (see the first solution within the "What alternative solutions did you explore"). It's almost perfect. It's simple and works great without any of the complexity of the other proposals. But as you will see, there's one caveat that might or might not be too big to ignore.

Check this: https://github.com/Expensify/App/issues/31389#issuecomment-1813349167, I've already suggested an upstream fix.

Who could open a PR to fix the upstream? Shall I assign @barros001 for this, @robertKozik?

bump @robertKozik

Yeah @barros001 has it in this alternative solutions so I think we can assign him

I just wanted to get some clarify on how to handle this before I accept the Upwork offer, as this is somewhat out of our hands in the sense that we can start a discussion with the native-html team, potentially even propose a PR, but it's totally up to them whether they are open to it or not. I'd say the first step would be to raise an issue with the css-processor to get the discussion started and see what they think of the issue. They could acknowledge and decide to address it, or they might shut it down.
Thoughts on how to handle it in relation to Expensify/Upwork?

@mountiny I think you've had past cases with issues that required upstream fixes. Do you have any thoughts on Carlos' question https://github.com/Expensify/App/issues/31389#issuecomment-1845907721?

I think we should definitely try to fix this upstream and I think we can wait some time too before creating some workaround for us as this is not really pressing issue

I just wanted to get some clarify on how to handle this before I accept the Upwork offer, as this is somewhat out of our hands in the sense that we can start a discussion with the native-html team, potentially even propose a PR, but it's totally up to them whether they are open to it or not. I'd say the first step would be to raise an issue with the css-processor to get the discussion started and see what they think of the issue. They could acknowledge and decide to address it, or they might shut it down.
Thoughts on how to handle it in relation to Expensify/Upwork?

@mountiny I think you missed our question. Could you please let us know your opinion about this 👆 ?

We would pay once this is fixed. Either through upstream or through a work around, in the mean time you dont have to be hired on upwork and thi issue can be put on hold for the outcome of the efforts to fix this upstream, if lets say in a month there is no traction you can try to fix this in App, then we would hire you.

Proposal
Please re-state the problem that we are trying to solve in this issue.
Windows emojis change when there is markdown in the message.
What is the root cause of that problem?
When there's any HTML (fragments/markdown..) on the comment, the TextCommentFragment will use RenderHTMLSource to render the element.
The TRenderEngineProvider from RenderHTMLSource use baseStyle to render the element inline style.
https://github.com/Expensify/App/blob/38b3990ce5a3823ee75ec32a56926befa592f47a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js#L76-L81
Until here we have 2 issues:

The font missing Windows Segoe UI Emoji, is not listed inside systemFonts props

The TRE will pick the first match as mentioned here
If we provide ⇒ font-family: 'ExpensifyNeue-Regular, Windows Segoe UI Emoji, Noto Color Emoji',
then the TRE will pick the 1st available font wih is ExpensifyNeue-Regular and will ignore the rest.

What changes do you think we should make in order to solve the problem?
1- We need to add Windows Segoe UI Emoji to systemFonts
const  emojiRenderfonts  = ['Windows Segoe UI Emoji', ..._.values(singleFontFamily)];
// rest of the code
systemFonts={emojiRenderfonts}

2- We need to change the baseStyle to something like
baseStyle={styles.webViewStyles.RenderHTMLSourceFontStyle}

Where RenderHTMLSourceFontStyle is a new style inside src/styles/styles.ts (Windows Segoe UI Emoji must be the 1st passed font)
RenderHTMLSourceFontStyle: {
            color: theme.text,
            fontSize: variables.fontSizeNormal,
            fontFamily: `Windows Segoe UI Emoji, ${fontFamily.EXP_NEUE}`,
            flex: 1,
            lineHeight: variables.fontSizeNormalHeight,
            ...writingDirection.ltr,
        },

POC

@sonialiap @robertKozik I worked on the same issue here.
I just noticed this one. Please check my proposal just posted. It's simple, easy fix and handle all similar issues.

@sonialiap @robertKozik I worked on the same issue here. I just noticed this one. Please check my proposal just posted. It's simple, easy fix and handle all similar issues.

Interesting! What do you think about this solution, @robertKozik?

@cristipaval I have already proposed the same solution earlier than @dragnoir in the other issue. It has some problems right now.  Example - If you use *text[emoji]*, it will not work properly right now
Let me see if I can solve it, and will let you know here.

@shubham1206agra this happen because the render-native-jtml will replace the  with a style specified here
https://github.com/Expensify/App/blob/f10f7089e105e90db9982ca0a6dffc8a0f592969/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js#L79
and the style is from here
https://github.com/Expensify/App/blob/f10f7089e105e90db9982ca0a6dffc8a0f592969/src/styles/index.ts#L143-L145
So when we have a  ******  and will be rendered with RenderHTMLSource, another style will be applied, and this can simply be fixed by changinf the strong style to:
strong: {
	fontWeight:  'bold',
},

POC:

@dragnoir I have listed only one case, there are many cases where this will break

@shubham1206agra I did more testing and it's working good.
Pls check my alternative solutions, it's better and use the same concept.

@dragnoir It still doesn't work properly

@shubham1206agra pls share the snippet that you used for testing and it doesn't work!

We would pay once this is fixed. Either through upstream or through a work around, in the mean time you dont have to be hired on upwork and thi issue can be put on hold for the outcome of the efforts to fix this upstream, if lets say in a month there is no traction you can try to fix this in App, then we would hire you.

@barros001 are you fine with this? Have you worked on the upstream fix yet?

@cristipaval yes, I'm totally fine with this. I have not yet worked on a upstream fix but I'll try and start the conversation over there.

@cristipaval @robertKozik proposal updated with clean steps to follow

Thanks for your proposal @dragnoir. We removed the Help Wanted label because we're going with the @barros001 proposal.

@barros001, do you have any updates?

Will take this as C+
@cristipaval Can you please assign me here (assuming there is work left to do here?)

@cristipaval Why is this issue put on hold? There is no open PR.
Let's try to get someone to submit a PR then we can put this on hold

@s77rt pls check my proposal when you have time, it solve all the issues, this one and others with the same problem like https://github.com/Expensify/App/issues/32833
The idea is not to assign any fonts to RenderHTMLSource and use the font from the app.

@dragnoir I think that's also a workaround. It's best to fix the root cause.

@cristipaval Why is this issue put on hold? There is no open PR.
Let's try to get someone to submit a PR then we can put this on hold

See this

They are not actif there, https://native-html.canny.io/features?status=complete
Zero completed feature. Some requested from 2021 with 8 rates and nothing. I don't feel an update is coming soon.
Maybe a PR here will grab more attention https://github.com/meliorence/react-native-render-html/pulls !

@cristipaval I agree with @dragnoir here. We should push for a PR rather than wait for the maintainers to implement the feature.

So, what's the next step here?

@barros001 Your PR is merged 🎉 Any plan on opening a PR on react-native-render-html

@barros001 could you please post an update when you have time?

Thanks @dragnoir! I'll close it then!


feat: migrate token balances controller to base controller v2

Explanation
The TokenBalancesController has been migrated to BaseControllerV2.
References
Closes #1808
Changelog
@metamask/token-balances-controller
Changed

BREAKING: Convert to BaseControllerV2

The constructor parameters have changed; rather than accepting a "config" parameter for interval and tokens we now pass both values as controller options, and a "state" parameter, there is now just a single object for all constructor arguments. This object has a mandatory messenger and an optional state, tokens, interval  properties a disabled property has also been added.
State now saves tokens  balances as strings and not as a BNs.
Additional BN export has been removed as it was intended to be removed in the next major release.

Checklist

[x] I've updated the test suite for new or updated code as appropriate
[x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
[x] I've highlighted breaking changes using the "BREAKING" category above as appropriate

BaseControllerV2 controllers now have a :getState action and :stateChange event by default, so we'll need to add TokenBalancesControllerGetStateAction and TokenBalancesControllerStateChangeEvent.
For reference (from https://github.com/MetaMask/core/issues/3707):

Introduce TransactionControllerGetStateAction type

You can use the ControllerGetStateAction utility type to create this; see TokenDetectionController for an example

Introduce TransactionControllerStateChangeEvent type

You can use the ControllerStateChangeEvent utility type to create the type; see TokenDetectionController for an example

Introduce TransactionControllerControllerEvents type, set to TransactionControllerStateChangeEvent
Introduce TransactionControllerControllerActions type, set to TransactionControllerGetStateAction
Update TransactionControllerMessenger to allowlist the above events and actions

Also, it seems like this controller should extend from StaticIntervalPollingController, not BaseControllerV2. The .{g,s}etIntervalLength() methods could be used instead of this.#interval. Although maybe this could be done in a separate PR?

BaseControllerV2 controllers now have a :getState action and :stateChange event by default, so we'll need to add TokenBalancesControllerGetStateAction and TokenBalancesControllerStateChangeEvent.
For reference (from #3707):

Introduce TransactionControllerGetStateAction type

You can use the ControllerGetStateAction utility type to create this; see TokenDetectionController for an example

Introduce TransactionControllerStateChangeEvent type

You can use the ControllerStateChangeEvent utility type to create the type; see TokenDetectionController for an example

Introduce TransactionControllerControllerEvents type, set to TransactionControllerStateChangeEvent

Introduce TransactionControllerControllerActions type, set to TransactionControllerGetStateAction

Update TransactionControllerMessenger to allowlist the above events and actions

missing types added

Also, it seems like this controller should extend from StaticIntervalPollingController, not BaseControllerV2. The .{g,s}etIntervalLength() methods could be used instead of this.#interval. Although maybe this could be done in a separate PR?

Currently TokenBalancesController is not tied to NetworkController and if I correctly I understood StaticIntervalPollingController require having networkClientId

@cryptodev-2s @MajorLift Re: inheriting from StaticIntervalPollingController, I believe the purpose of that superclass is to ensure that polling can be performed in a multichain-compatible way. I don't think this controller has been converted to be multichain-compatible yet — I think it's still on the DevEx team's board to do that. So perhaps we stick with BaseControllerV2 for now and then if they see the need to migrate this class to StaticIntervalPollingController, they can do that, or we can if we end up taking it over from them.


Build is broken due to panic_fmt being broken

Trying to compile the LED example from chapter 5 results in this:
$> cargo build --target thumbv7em-none-eabihf
   Compiling cortex-m-rt v0.3.15
error[E0522]: definition of an unknown language item: `panic_fmt`
 --> C:\Users\maxst\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-rt-0.3.15\src\lang_items.rs:3:1
  |
3 | #[lang = "panic_fmt"]
  | ^^^^^^^^^^^^^^^^^^^^^ definition of unknown language item `panic_fmt`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0522`.
error: Could not compile `cortex-m-rt`.

To learn more, run the command again with --verbose.

The reason for this is due to this:
https://users.rust-lang.org/t/psa-breaking-change-panic-fmt-language-item-removed-in-favor-of-panic-implementation/17875

Which nightly should we install so that it still works?

I've been using nightly-2018-05-20, but I'd guess most nightlies that are around the latest code commits in this repo would work.

2018-06-01 works too.

How do we fix this? part of the problem is that the cargo.toml specifies an older version of cortex-m-rt, which you can fix naively by going to the source and adding #![feature(panic_implementation)], but looking at more recent versions of cortex-m-rt it looks totally different.

Rolling back versions is a short term solution which I would rather not do. Seeing as new versions of cortex-m-rt have removed the abort-on-panic feature, I thought I would try removing it, adding the panic-abort crate, and bumping all the dependencies (all in 05/auxiliary/Cargo.toml). It still doesn't build though, so not sure how to fix it:
error: language item required, but not found: `panic_impl`
error: language item required, but not found: `eh_personality`

(See: https://users.rust-lang.org/t/psa-breaking-change-panic-fmt-language-item-removed-in-favor-of-panic-implementation/17875)

This just bit me on chapter 16 as well.
I was able to get it to compile by adapting the panic implementation (see diff)
diff --git a/src/16-punch-o-meter/auxiliary/src/lib.rs b/src/16-punch-o-meter/auxiliary/src/lib.rs
index 5484cd7..e268ec8 100644
--- a/src/16-punch-o-meter/auxiliary/src/lib.rs
+++ b/src/16-punch-o-meter/auxiliary/src/lib.rs
@@ -2,6 +2,7 @@

 #![feature(lang_items)]
 #![feature(use_extern_macros)]
+#![feature(panic_implementation)]
 #![no_std]

 extern crate cortex_m;
@@ -49,20 +50,17 @@ pub fn init() -> (Lsm303dlhc, Delay, MonoTimer, ITM) {
     (lsm303dlhc, delay, mono_timer, cp.ITM)
 }

-#[lang = "panic_fmt"]
-unsafe extern "C" fn panic_fmt(
-    args: ::core::fmt::Arguments,
-    file: &'static str,
-    line: u32,
-    col: u32,
-) -> ! {
-    let itm = &mut *ITM::ptr();
-
-    itm::write_str(&mut itm.stim[0], "PANIC at '");
-    itm::write_fmt(&mut itm.stim[0], args);
-    iprintln!(&mut itm.stim[0], "', {}:{}:{}", file, line, col);
-
+use core::panic::PanicInfo;
+#[panic_implementation]
+fn panic(_info: &PanicInfo) -> ! {
+    unsafe {
+        let itm = &mut *ITM::ptr();
+
+        let location = _info.location().unwrap();
+        itm::write_str(&mut itm.stim[0], "PANIC at '");
+        itm::write_str(&mut itm.stim[0], _info.payload().downcast_ref::<&str>().unwrap());
+        iprintln!(&mut itm.stim[0], "', {}:{}:{}", location.file(), location.line(), location.column());
+    }
     cortex_m::asm::bkpt();
-
     loop {}
 }

However, I am getting a linking error now:
       Fresh semver-parser v0.7.0
       Fresh libc v0.2.42
       Fresh vcell v0.1.0
       Fresh bare-metal v0.1.2
       Fresh aligned v0.1.2
       Fresh nb v0.1.1
       Fresh void v1.0.2
       Fresh untagged-option v0.1.1
       Fresh r0 v0.2.2
       Fresh cast v0.2.2
       Fresh m v0.1.1
       Fresh semver v0.9.0
       Fresh time v0.1.40
       Fresh volatile-register v0.2.0
       Fresh embedded-hal v0.2.1
       Fresh num-traits v0.2.5
       Fresh rustc_version v0.2.2
       Fresh cortex-m v0.3.1
       Fresh cortex-m v0.4.3
       Fresh embedded-hal v0.1.3
       Fresh num-integer v0.1.39
       Fresh l3gd20 v0.1.2
       Fresh lsm303dlhc v0.1.2
       Fresh chrono v0.4.4
       Fresh cortex-m-rt v0.3.15
       Fresh stm32f30x v0.6.2
       Fresh stm32f30x-hal v0.1.2
       Fresh f3 v0.5.3
       Fresh aux16 v0.1.0 (file:///home/eldruin/projects/f3/discovery/src/16-punch-o-meter/auxiliary)
   Compiling punch-o-meter v0.1.0 (file:///home/eldruin/projects/f3/discovery/src/16-punch-o-meter)
     Running `rustc --crate-name punch_o_meter src/16-punch-o-meter/src/main.rs --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=7f24593758ba53f2 -C extra-filename=-7f24593758ba53f2 --out-dir /home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps --target thumbv7em-none-eabi -L dependency=/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps -L dependency=/home/eldruin/projects/f3/discovery/target/debug/deps --extern aux16=/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libaux16-e52008c08692899e.rlib --extern m=/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libm-c2d2fe2c5ae773a1.rlib -L /home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/build/f3-4fc456239fba8fde/out -L /home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/build/cortex-m-rt-b4b3f7fbab5c6b77/out`
error: linking with `arm-none-eabi-gcc` failed: exit code: 1
  |
  = note: "arm-none-eabi-gcc" "-L" "/home/eldruin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabi/lib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/punch_o_meter-7f24593758ba53f2.punch_o_meter0.rcgu.o" "-o" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/punch_o_meter-7f24593758ba53f2" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps" "-L" "/home/eldruin/projects/f3/discovery/target/debug/deps" "-L" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/build/f3-4fc456239fba8fde/out" "-L" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/build/cortex-m-rt-b4b3f7fbab5c6b77/out" "-L" "/home/eldruin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabi/lib" "-Wl,-Bstatic" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libm-c2d2fe2c5ae773a1.rlib" "-Wl,--start-group" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libaux16-e52008c08692899e.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libf3-5410013488dc6fe6.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libstm32f30x_hal-59cba9db1666eb02.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libstm32f30x-a042881db84c13ed.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libcortex_m_rt-94b764977b1bc8aa.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libr0-cb0bc673be809319.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libcortex_m-b64df0b1502144eb.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/liblsm303dlhc-f3ee7ad6c49eb30c.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libcast-17056d054cc49be3.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libl3gd20-0f7e94447fe70c86.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libembedded_hal-91b3b70362fe8e08.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libembedded_hal-4f156a7ea9f1d2ea.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libvoid-a50b1ced8cc178a7.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libnb-30ceca99e0db5b45.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libcortex_m-60edf070c8ea0a80.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libvolatile_register-72f08a9826a902a9.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libvcell-724593602ddd1d04.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libuntagged_option-5213723b27ec0ad1.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libbare_metal-13c184ae01490ca6.rlib" "/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libaligned-46f4faa89abe89d0.rlib" "/home/eldruin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabi/lib/libcore-fd8db0016eac6efd.rlib" "-Wl,--end-group" "/home/eldruin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/thumbv7em-none-eabi/lib/libcompiler_builtins-767c0e10cdd39be6.rlib" "-Wl,-Bdynamic"
  = note: /usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/lib/crt0.o: In function `_start':
          /build/newlib-5zwpxE/newlib-2.2.0+git20150830.5a3d536/build/arm-none-eabi/libgloss/arm/../../../../libgloss/arm/crt0.S:419: undefined reference to `atexit'
          /build/newlib-5zwpxE/newlib-2.2.0+git20150830.5a3d536/build/arm-none-eabi/libgloss/arm/../../../../libgloss/arm/crt0.S:421: undefined reference to `__libc_init_array'
          /build/newlib-5zwpxE/newlib-2.2.0+git20150830.5a3d536/build/arm-none-eabi/libgloss/arm/../../../../libgloss/arm/crt0.S:427: undefined reference to `exit'
          /build/newlib-5zwpxE/newlib-2.2.0+git20150830.5a3d536/build/arm-none-eabi/libgloss/arm/../../../../libgloss/arm/crt0.S:427: undefined reference to `__libc_fini_array'
          collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile `punch-o-meter`.

Caused by:
  process didn't exit successfully: `rustc --crate-name punch_o_meter src/16-punch-o-meter/src/main.rs --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=7f24593758ba53f2 -C extra-filename=-7f24593758ba53f2 --out-dir /home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps --target thumbv7em-none-eabi -L dependency=/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps -L dependency=/home/eldruin/projects/f3/discovery/target/debug/deps --extern aux16=/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libaux16-e52008c08692899e.rlib --extern m=/home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/deps/libm-c2d2fe2c5ae773a1.rlib -L /home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/build/f3-4fc456239fba8fde/out -L /home/eldruin/projects/f3/discovery/target/thumbv7em-none-eabi/debug/build/cortex-m-rt-b4b3f7fbab5c6b77/out` (exit code: 101)

Can anybody help me here?

Sorry for the trouble and the delay. #86 has updated the whole book to work with the latest version of the cortex-m crates as well as with recent nightlies.


Switch to setup-micromamba

mamba-org/provision-with-micromamba is deprecated.

Thanks for the fix @pavelzw


Fix 'Onboarding Enter Private Key: Error Text #1045'

🗃 Github Issue Or Explanation for this PR. (What is it supposed to do and Why is needed)
https://github.com/JoinSEEDS/seeds_light_wallet/issues/1045
✅ Checklist

[x] Github issue details are up to date for people to QA.
[x] I have tested all my changes.

🕵♂ Notes for Code Reviewer
None.
🙈 Screenshots
Not a UI change.
👯♀ Paired with
Nobody.

@gguij004  please review this, and merge your open approved prs as soon as possible

@gguij004 please review this, and merge your open approved prs as soon as possible

Prs are already merge.

Resolved the conflicts and re-applied the fix. Ready to merge again 🤓

Can someone with write access merge this in please? 🙏

Can someone with write access merge this in please? 🙏

Done and getting you write access


Provide warning when data/watch/computed etc. conflicts with existing Vue object properties

What problem does this feature solve?
I accidentally created a data attribute called language. It seems this attribute conflicts with some existing properties of Vue object.
There were no warnings, but the attribute won't be updated by this.$data.language, it stays as initial value. All other data attributes do work correctly. When console.log(this.$data)'d it shows 2 language properties, one with initial value, the other is dynamic as (...). After changing this attribute to lang everything works.
Considering data/watch/computed etc. all ends up as properties of Vue object, it would be nice to have some warning or exception if there are conflicts.
What does the proposed API look like?
AttributeError: "language" is a reserved property name and should not be avoided.

the conflict doesn't come from Vue, it comes from a library adding it. The warning should be implemented there