Offtopic group for casual talking about anything. @rules_for_python still apply (except for the ontopic rule)
It’ll treat you depending on market condition to put it precisely
Читать полностью…it s more like "do you do good? well, private gonna treat you like a prince"
Читать полностью…That’s called union. People make it in private companies too. It’s very incompetent approach and breeds inefficiency
Читать полностью…but it s a trade off. even if we are 3 devops, if something happened cause of me, it s not "devops team bad" but my bad only
Читать полностью…i.e. I just had to prove my skills to get a promotion to a different role and the switch was direct
Читать полностью…But how does private vs public effect roles?
You’d have scale which requires dedicated resources
Don't forget to replace the code with a link to the code as suggested by Doragon.
Читать полностью…What's the problem? That all applications receive notifications? How would you decide which application to send the notification to if there's only supposed to be one?
Читать полностью…notifications.py:
push_service = FCMNotification(service_account_file=settings.FCM_SERVICE_ACCOUNT_FILE)Читать полностью…
@sync_to_async
def send_notifications(registration_ids: list[str], title: str, body: str) -> None:
params_list = [{"fcm_token": fcm_token, "notification_title": title, "notification_body": body}
for fcm_token in registration_ids]
result = push_service.async_notify_multiple_devices(params_list=params_list)
return result
@sync_to_async
def get_tokens(user: User) -> list[str]:
tokens = [notification.token for notification in user.notifications.all()]
return tokens
async def send_notification_to_user(user: User, title: str, body: str) -> None:
tokens = await get_tokens(user)
results = await send_notifications(tokens, title, body)
invalid_tokens = []
for i, response in enumerate(results):
if "error" in response and "registration token" in response["error"]["message"]:
invalid_tokens.append(tokens[i])
await UserNotification.objects.filter(token__in=invalid_tokens).adelete()
🤔something familiar. Yeah, this is nice, I think I've heard the version with non-glitching bass.
Читать полностью…"do you feel sick and you cant manage to work as the other days? ush you are not getting paid if you dont come"
Читать полностью…but as I said it s a trade off. you are covered a lot more inside the public rather than the private
Читать полностью…in the public is everyone bad or everyone did good. even if 3/4 of people did nothing
Читать полностью…Both structures are different. Hiring, promotion, project allocation works differently obviously.
Читать полностью…in the public you cant go somewhere and ask to change your role or to do something different from what you are doing. I mean, you can but it s not immediate or it is quite hard to get paid more
Читать полностью…Although, I'm not sure why the code would be necessary at all.
Читать полностью…I don't think you can make that choice. But you can let the user decide in which application he wants to receive notifications and in which not, storing the information in the browser. Three different browsers make three different places where the configuration is stored.
Читать полностью…Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://dpaste.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.
I have a question. If a user uses a website from 3 browsers at once and also a PWA, the service will save 4 of his tokens, and notifications for him will be duplicated. How can this problem be solved? What standard for controlling push notifications exists? I don't see a solution to the problem in sending only to one token.
Читать полностью…